[Home] [By Thread] [By Date] [Recent Entries]
The second is a reference to a global element - there can be more than one such reference to a single global element (and ideally should be, which is why one would create a global element in the first place). The first reference can be either a declaration of a global element, or a local element, depending on where it is placed in a schema (your example did not indicate placement). If it is placed one level under the <xs:schema> element, it is global - otherwise (e.g. within a "choice" construct) it is local. Kind Regards, Joseph Chiusano Booz Allen Hamilton Visit us online@ http://www.boozallen.com > -----Original Message----- > From: Baisak, Ranjan [mailto:ranjan_baisak@m...] > Sent: Monday, March 14, 2005 7:10 AM > To: xml-dev@l... > Subject: What's difference between ref and type in > XML schema > > I am bit confused regarding referring an element and > creating a data type for an element and referring it. > E.g. > Referring by type > <xsd:element name="A" type="AType" maxOccurs="unbounded"/> > <xsd:complexType name="AType"> > .. > </xsd:complexType> > > Referring by element itself > <xsd:element ref="A" maxOccurs="unbounded"/> <xsd:element name="A"> > <xsd:complexType> > ... > </xsd:complexType> > </xsd:element> > > > > regards, > -Ranjan > > ----------------------------------------------------------------- > The xml-dev list is sponsored by XML.org > <http://www.xml.org>, an initiative of OASIS > <http://www.oasis-open.org> > > The list archives are at http://lists.xml.org/archives/xml-dev/ > > To subscribe or unsubscribe from this list use the subscription > manager: <http://www.oasis-open.org/mlmanage/index.php> > >
|

Cart



