XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Difference betwwen element name= and element ref=

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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS