OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] What's difference between ref and type in XML schema

[ Lists Home | Date Index | Thread Index ]
  • To: "Baisak, Ranjan" <ranjan_baisak@mentorg.com>, <xml-dev@lists.xml.org>
  • Subject: RE: [xml-dev] What's difference between ref and type in XML schema
  • From: "Chiusano Joseph" <chiusano_joseph@bah.com>
  • Date: Mon, 14 Mar 2005 21:04:20 -0500
  • Thread-index: AcT6bTU3FpRFKU59SsGlp9w6R6TTNwuIRbDAAB0ulrA=
  • Thread-topic: [xml-dev] What's difference between ref and type in XML schema

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@mentorg.com] 
> Sent: Monday, March 14, 2005 7:10 AM
> To: xml-dev@lists.xml.org
> Subject: [xml-dev] 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>
> 
> 




 

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

Copyright 2001 XML.org. This site is hosted by OASIS