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


Help: OASIS Mailing Lists Help | MarkMail Help



   XML Schemas: Adding nullable="true" to a ref element

[ Lists Home | Date Index | Thread Index ]
  • From: "Roger L. Costello" <costello@mitre.org>
  • To: xml-dev@lists.xml.org
  • Date: Tue, 12 Sep 2000 12:02:32 -0400

Hi Folks,

Is this legal:

<element name="elevation" type="positiveInteger"/>
<element name="aircraft">
      <element ref="a:elevation" nullable="true"/>

My legality question is with regards to nullability when ref'ing another
element.  The element within aircraft above:

   <element ref="a:elevation" nullable="true"/>

seems to be stating, "use the element declaration referred to by "ref"
but add the ability to have have a null attribute on <elevation> in the
instance document", i.e.,

     <elevation null="true"/>

Thus, <element ref="a:elevation" nullable="true"/> is modifying the
elevation declaration to incorporate nullability.  My guess would be
that this is illegal.  Beyond the reference, a reference element can
only indicate the number of occurrences, such as:

   <element ref="a:elevation" minOccurs="1" maxOccurs="1"/>


On the other hand, I can see many uses for this ability to enhance a
declaration by adding a nullable="true" attribute onto a ref element. 
Suppose that in the aircraft case we would like the elevation element to
have nullability, whereas in another scenario nullability may not be
desired on the elevation element.  The same element declaration:

   <element name="elevation" type="positiveInteger"/>

can be ref'ed but in one case with nullable:

   <element ref="a:elevation" nullable="true"/>

and in the second case without nullable:

   <element ref="a:elevation"/>

So, what's the bottom line with regards to ref'ing an element
declaration?  Can it have attributes, such as nullable, which
effectively modify the element being referenced?



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

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