I'm trying to put together an XSD schema to represent the XML required to feed into a program that generates a test. I've done ok so far, however some of my complex types contain elements with name="#comment". This is not going over well, as apparently # is not an acceptable character for a element name.
Is there a way to escape out the # or represent it with, perhaps, an html or ascii code? I have pasted sample xml and sample of the unhappy complex type below.
I ask because the code has been in use a while and it would be problematic to change it to support, for instance name="comment"
Sample XML
Sample Schema
Is there a way to escape out the # or represent it with, perhaps, an html or ascii code? I have pasted sample xml and sample of the unhappy complex type below.
I ask because the code has been in use a while and it would be problematic to change it to support, for instance name="comment"
Sample XML
Code:
<main>
<Window>
<Data><Var name="varname">varval</Var></Data>
<#comment>This var represents the variable name and value</#comment>
</Window>
</main>
Sample Schema
Code:
<xs:complexType name="WindowType">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Data" type="dataElementType" />
<xs:element name="#comment" type="emptyType" />
</xs:choice>
</xs:complexType>