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

  • To: "Baisak, Ranjan" <ranjan_baisak@m...>, <xml-dev@l...>
  • Subject: RE: What's difference between ref and type in XML schema
  • From: "Chiusano Joseph" <chiusano_joseph@b...>
  • Date: Mon, 14 Mar 2005 21:04:20 -0500
  • Thread-index: AcT6bTU3FpRFKU59SsGlp9w6R6TTNwuIRbDAAB0ulrA=
  • Thread-topic: 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@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>
> 
> 

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member