[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Difference betwwen element name= and element ref=

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

xs element name

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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.