ok21
May 21st, 2011, 07:23 AM
When I create a new XSD what is standard way to describe its syntasis -
names of elements,
attributes each of them,
what's attributes are mandatatory and what's are optionally
links between elements,
etc...?
I can create additional XSD, that contains all these rules or may be exists standard solution?
britney12
August 21st, 2011, 01:51 AM
Elements are the main building block of any XML document. They contain the data and determine the structure of the document. An element can be defined within an XML Schema (XSD) as follows:
<xs:element name="x" type="y"/>
An element definition within the XSD must have a name property, which is the name that will appear in the XML document. The type property provides the description of what can be contained within the element when it appears in the XML document. There are a number of predefined types, such as xs:string, xs:integer, xs:boolean and xs:date (see XSD standard for a complete list). You can also create user defined types using the <xs:simpleType> and <xs:complexType> tags, but more on these later.
If we have set the type property for an element in the XSD, then the corresponding value in the XML document must be in the correct format for its given type (failure to do this will cause a validation error). Examples of simple elements and their XML are shown below:
Sample XSD Sample XML
<xs:element name="Customer_dob" type="xs:date"/>
<Customer_dob>
2000-01-12T12:13:14Z
</Customer_dob>
<xs:element name="Customer_address" type="xs:string"/>
<Customer_address>
99 London Road
</Customer_address>
<xs:element name="OrderID" type="xs:int"/>
<OrderID>
5756
</OrderID>
<xs:element name="Body" type="xs:string"/>
<Body> (a type can be defined as a string but not have any
content, this is not true of all data types however).</Body>
Overseas consultants in India (http://www.imtpconsultants.com/)