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

  • From: "Radu Cernuta" <radu.cernuta@g...>
  • To: "Dominique Casserres" <Dominique.Casserres@v...>
  • Date: Tue, 14 Nov 2006 20:58:23 +0100

Hello,

When no type is specified as in the case of < xs:element name="Customer" /> the xs:anyType is being assigned and your element will accept any content model, including eventually the one you defined in your global element definition for Customer, but also anything else.

Greetings,

Radu



2006/11/14, Dominique Casserres <Dominique.Casserres@v...>:

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