Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Can this schema be written in XML Schema?

From: Dr Mark H Phillips <mark@--------.---.-->
To: xmlschema-dev@--.---
Date: 12/1/2005 4:34:00 AM
Hi,

I have a simple schema that I wish to use for XML documents.
I've been reading up on XML Schema, trying to find a way of
expressing my schema using it, but so far have failed.  I 
suspect it is currently not possible but thought I would ask 
on this list.  Is it possible, and if not, is XML Schema likely 
to support it at some stage?

Let me explain my schema.  It has a root element called "root".
Every element has precisely one attribute called "is", which 
must take one of three values: "atom", "hash" or "list".  The 
root element must have is="hash", but all other elements can be 
any of the three, the default being "atom".  An atom element
must only have simple content.  A hash element must have element
content only, moreover it must not have more than one child element
of the same name.  A list element must have element content only,
this being elements all called "item" (ie it will have 0 or more
elements, all called "item").

Here is a simple example of a valid xml document:

<?xml version="1.0" encoding="ISO-8859-1"?>
<root is="hash">
  <name>Laura Jones</name>
  <address is="hash">
    <street>123 Trendy Avenue</street>
    <suburb>Prestigious Lakes</suburb>
    <postcode>4321</postcode>
  </address>
  <pets is="list">
    <item>Ginger</item>
    <item>Polly</item>
    <item is="hash">
      <name>Rover</name>
      <breed>Bulldog</breed>
    </item>
  </pets>
  <matrix is="list">
    <item is="list">
      <item>1</item><item>0</item><item>1</item>
    </item>
    <item is="list">
      <item>0</item><item>1</item><item>0</item>
    </item>
    <item is="list">
      <item>1</item><item>0</item><item>1</item>
    </item>
  </matrix>
</root>

What I'd like to do, is to define my schema as a "base schema"
which doesn't say anything about the specifics of a particular
structure, but only enforces the simple rules mentioned above.
The idea would then be to take this base schema and add to
it specific rules (for example about "name", "address", "pets"
and "matrix") to form more tied-down schemas.

Nothing I've read about XML-Schema seems to be appropriate for 
what I'm trying to achieve.  Any help would be much appreciated!

Mark Phillips.





From noah_mendelsohn@u... Wed Nov 30 14:56:34 2005
Received: from lisa.w3.org ([128.30.52.41])
	


transparent
Print
Mail
Digg
delicious
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