Search code examples
xmlescapingspecial-characters

Square brackets in XML?


In an XML document, how do I treat square brackets (] or [) ?


Solution

  • There is probably a better solution. But this works:

    ]
    

    as in:

    <blah value="&#x005D;"></blah>
    

    then again, so does (see Kirtan's answer):

    <blah value="]"></blah>