[Home] [By Thread] [By Date] [Recent Entries]

  • From: "Dominique Casserres" <Dominique.Casserres@v...>
  • To: <xml-dev@l...>
  • Date: Tue, 14 Nov 2006 18:02:34 +0100

Hello all, I have the following example.

For my understanding of schema, I should have been obliged to use <xs:element ref="tns:Customer" /> but <xs:element name="Customer" /> is valid.

For me, element name = means I am going to declare the content of Customer element inline. Here I think I should be obliged to use ref and I is not the case.

Can someone can enlighten me on tis.

Dominique

 

 

xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:valtech-com:phonebill" targetNamespace="urn:valtech-com:phonebill" elementFormDefault="qualified" attributeFormDefault="unqualified">

            <xs:element name="PhoneBill">

                        <xs:complexType>

                                   <xs:sequence>

                                   <!-- with name , the schema is valid-->

                                   <!-- if ref, i am obliged to use  ref='tns:Customer' -->

                                               <xs:element name="Customer" />

                                   </xs:sequence>

                                   <xs:attribute name="id" type="xs:string" use="required"/>

                                   <xs:attribute name="amount" type="xs:float" use="required"/>

                                   <xs:attribute name="currency" type="xs:string" use="required"/>

                        </xs:complexType>

                       

            </xs:element>

            <xs:element name="Customer">

                        <xs:complexType>

                                   <xs:attribute name="id" type="xs:string" use="required"/>

                                   <xs:attribute name="firstName" type="xs:string" use="required"/>

                                   <xs:attribute name="lastName" type="xs:string" use="required"/>

                                   </xs:complexType>

                        </xs:element>

</xs:schema>

 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member