You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/_admin-guide/120_Parser/022_XML_parser/000_Limitations.md
+72-6Lines changed: 72 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,11 @@ description: >-
7
7
8
8
The XML parser comes with certain limitations.
9
9
10
-
## Vector-like structures
10
+
## Using the list-handling functionality with vector-like structures
11
11
12
-
It is not possible to address each element of a vector-like structure
13
-
individually. For example, take this input:
12
+
The XML parser uses the list-handling functionality to handle lists in the XML. The list-handling functionality has limitations when handling name-value pairs or quoting in SDATA as described below. Note that you can disable the list-handling functionality if needed.
13
+
14
+
The list-handling functionality of the XML parser separates vector-like structures by a comma as separate entries. Using the following structure as an example:
14
15
15
16
```xml
16
17
<vector>
@@ -21,10 +22,11 @@ individually. For example, take this input:
21
22
</vector>
22
23
```
23
24
24
-
After parsing, the entries cannot be addressed individually. Instead,
25
-
the text of the entries will be concatenated:
25
+
After parsing, the entries are separated by a comma. If an entry has a space or is separated by a comma, for example, `value 2` or `Doe,John` in the previous example, quoting is applied to the entry:
## Using the list-handling functionality with SDATA
49
+
50
+
According to RFC5424, SDATA parameter values must be quoted with double-quote ('"') characters. If the value contains double-quotes, they must be escaped with a backslash (\) character.
51
+
52
+
Due to the list-handling functionality of the XML parser, parsed XML text contents are also quoted using double-quote ('"') characters. As parsed XML text content are part of the message, they are quoted when used as SDATA parameter values.
53
+
54
+
Using the following structure as an example:
55
+
56
+
```xml
57
+
<Event>
58
+
<Data>42</Data>
59
+
<Data>Testing testing</Data>
60
+
</Event>
61
+
```
62
+
63
+
The expected name-value pair is as follows:
64
+
65
+
```xml
66
+
Event.Data = 42,"Testing testing"
67
+
```
68
+
69
+
In SDATA, this is quoted as shown below:
70
+
71
+
```xml
72
+
[Event Data="42,\"Testing testing\""]
73
+
```
74
+
75
+
## Disabling the list-handling functionality
76
+
77
+
To disable the list-handling functionality, use the create_lists(`yes`/`no`) option as shown below. The default value is set to `yes`.
78
+
79
+
```xml
80
+
parser p_xml {
81
+
xml(create_lists(no));
82
+
};
83
+
```
84
+
85
+
Note that if you disable the list-handling functionality, the XML parser cannot address each element of a vector-like structure individually. Using the following structure as an example:
86
+
87
+
```xml
88
+
<vector>
89
+
<entry>value1</entry>
90
+
<entry>value2</entry>
91
+
...
92
+
<entry>valueN</entry>
93
+
</vector>
94
+
```
95
+
96
+
After parsing, the entries are not addressed individually. Instead, the text of the entries are concatenated:
97
+
98
+
```xml
99
+
vector.entry = "value1value2...valueN"
100
+
```
101
+
36
102
## CDATA
37
103
38
104
The XML parser does not support CDATA. CDATA inside the XML input is
0 commit comments