Suppose I have a Dictionary<string, string> instance, like this one:
{ { “a”, “1” }, { “b”, “2” } }
There are several ways to represent it in XML:
<root>
<item>
<key>a</key>
<value>1</value>
</item>
<item>
<key>b</key>
<value>2</value>
</item>
</root>
OR
<root>
<item key="a" value="1"/>
<item key="b" value="2"/>
</root>
OR
<root>
<a>1</a>
<b>2</b>
</root>
What is the XML schema to describe each of the representations?
Thanks.
Look at
xs:uniqueelement.For 1st XML appropriate XSD is:
For 2nd:
For 3rd: