CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Posts
    54

    Cool How describe a new XSD

    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?

  2. #2
    Join Date
    Aug 2011
    Posts
    2

    Re: How describe a new XSD

    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 xsate (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="xsate"/>
    <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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured