Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: multiple elements with different names but same type

From: "Michael Kay" <mike@--------.--->
To: "'Luke Graham'" <lukeg@----------.---.-->, <xmlschema-dev@--.--->
Date: 1/18/2005 10:04:00 AM
> 
> I have a problem with some schemas that Im writing. They look 
> as follows...
> 
> <xs:complexType name="foo"/>
> 
> <xs:element name="_1" type="foo"/>
> <xs:element name="_2" type="foo"/>
> .....
> 
> I want to write something along these lines instead...
> 
> <xs:element name="*" type="foo" minOccurs="0" maxOccurs="64"/>
> 
> Is it possible?

No. Is this a vocabulary you are designing, or one that already exists? It
looks as if it's trying to capture information by means of structured
element names, which is always a bad idea: use attributes instead.
> 
> And... I want to give a range to a simple integer, without deriving a 
> new type -
> 
> <xs:element name="bar" type="xs:int" minInclusive="0" 
> maxInclusive="10"/>
> 
> Do I really have to derive a new type each time? That seems excessive.

Each of the elements has a different type, so it seems reasonable to
acknowledge the fact. You can use anonymous types if you want. The syntax is
long-winded but at least it doesn't try to hide what's happening:

<xsl:element name="bar">
  <xs:simpleType>
    <xs:restriction base="xs:integer">
       ...

Michael Kay
http://www.saxonica.com/


From george@o... Tue Jan 18 17:05:38 2005
Received: from bart.w


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent