Advertisement
fili

XSDe XML and schema

Nov 29th, 2013
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 0.70 KB | None | 0 0
  1. Schema:
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:myns="http://domain.com/myns" targetNamespace="http://domain.com/myns">
  3.   <xs:complexType name="root">
  4.     <xs:sequence>
  5.         <xs:element name="type" type="myns:type" minOccurs="0" maxOccurs="unbounded"/>
  6.     </xs:sequence>
  7.   </xs:complexType>
  8.  
  9.   <xs:complexType name="type">
  10.     <xs:attribute name="id" type="xs:int" use="required"/>
  11.   </xs:complexType>
  12.  
  13.   <xs:element name="root" type="myns:root"/>
  14.  
  15. </xs:schema>
  16.  
  17. XML:
  18. <?xml version="1.0" encoding="UTF-8"?>
  19. <myns:root xmlns:myns="http://domain.com/myns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://domain.com/myns my.xsd">
  20. </myns:root>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement