Can I use <0> </0> in xml?

I am trying to create an XML file (which will be converted to JSON later).

So I have to respect the schema and I need to put <0> and <1 in the XML, but that won't work. I am also trying to set <\ 0> and <\ 1> but it says it is not a good char for XML.

<Result>
    <Content>
        <0></0>
        <1></1>
    </Content>
</Result>

      

In the Visual Studio debugger, I have set a breakpoint on the target to see the xml, but with <0>, I cannot open the document as XML, only as text.

How can I fix this?

+3


source share


2 answers


It's impossible. XML element names must begin with a letter or underscore .



+7


source


Perhaps, but you should use a tag CDATA

, but that means they are not really XML elements. This method is used when placing HTML in an XML file.



<Result>
    <Content>
        <![CDATA[
            <0>
           </0>
           <1>
          </1>
       ]]>
    </Content>
</Result>

      

+2


source







All Articles