xml schema for element with attribute and text content in XML Posted February 13, 2014 I am trying to create xml schema for this element... <shoesize country="yes">35</shoesize> based on w3 schools this is solution.... <?xml version="1.0" encoding="utf-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:element name="shoesize"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:integer"> <xs:attribute name="country" type="xs:string" /> </xs:extension> </xs:simpleContent> </xs:complexType></xs:element></xs:schema> what I am trying to restrict is that attribute can only be "yes" or "no" and content can only be integer less than 50. Can anyone give me some pointers how to do this please.
xml schema for element with attribute and text content
in XML
Posted
I am trying to create xml schema for this element...
based on w3 schools this is solution....
what I am trying to restrict is that attribute can only be "yes" or "no" and content can only be integer less than 50. Can anyone give me some pointers how to do this please.