Square brackets in XML?
13,944
Solution 1
There is probably a better solution. But this works:
]
as in:
<blah value="]"></blah>
then again, so does (see Kirtan's answer):
<blah value="]"></blah>
Solution 2
Square brackets do not need a specific notation in XML but they have a special meaning when used in XPath expressions for XSL transformations.
<root>
<el attrib="[">[</el>
</root>
Solution 3
">" does not require to be escaped.
"]" does not require to be escaped.
"]]>" require to be escaped as part of the CDATA element.
Comments
-
Rahul Vyas almost 2 years
In an XML document, how do I treat square brackets (] or [) ?
-
Ryan Rodemoyer almost 11 yearsFunny, your answer is a direct copy from webdeveloper.com/forum/…