code_junkie

XML Schema: Element with attributes containing only text?

Nov 13th, 2011
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <option value="test">sometext</option>
  2.  
  3. <xs:element name="option">
  4. <xs:complexType>
  5. <xs:attribute name="value" type="xs:string" />
  6. </xs:complexType>
  7. </xs:element>
  8.  
  9. <xs:element name="option" type="AttrElement" />
  10.  
  11. <xs:complexType name="AttrElement">
  12. <xs:simpleContent>
  13. <xs:extension base="xs:string">
  14. <xs:attribute name="value" type="xs:string">
  15. </xs:attribute>
  16. </xs:extension>
  17. </xs:simpleContent>
  18. </xs:complexType>
  19.  
  20. <xs:element name="option">
  21. <xs:complexType>
  22. <xs:simpleContent>
  23. <xs:extension base="xs:string">
  24. <xs:attribute name="value" type="xs:string">
  25. </xs:attribute>
  26. </xs:extension>
  27. </xs:simpleContent>
  28. </xs:complexType>
  29. </xs:element>
Add Comment
Please, Sign In to add comment