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


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Possible to use wildcards in schema element names?

Hi all,
I'm trying to generate a schema for some xml (for which I have no
control over the format)
Consider the following xml example:
<?xml version="1.0" encoding="UTF-8"?>
   <field1>abc</field1> <!-- any number of fields -->

   <field3>uvw</field3> <!-- need not start with field1 -->

As you can see, each "name" element has a varying number of "field*" siblings.
So, I've come with the following attempt (the eagle-eyed among you,
may notice that I'm no expert):
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
 <xs:element name="document">
       <xs:choice maxOccurs="unbounded">
         <xs:element ref="name"/>
         <xs:element ref="field" maxOccurs="unbounded"/>
 <xs:element name="name" type="xs:NCName"/>
 <xs:element name="field*" type="xs:NCName"/> <!-- How is it possible
to perform wildcard? -->

My question then is, "Is it possible, in the schema, to use wildcards
or regex for the field elements?

Many thanks in anticipation - Jimmy

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

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

Copyright 1993-2007 XML.org. This site is hosted by OASIS