W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2008

Schema Newbie Boxed in a corner . . .

From: Frank Merrow <fmerrow@qualcomm.com>
Date: Fri, 25 Apr 2008 13:45:17 -0700
Message-Id: <200804252045.m3PKjKoT016255@msgtransport03.qualcomm.com>
To: xmlschema-dev@w3.org
So I am writing my first Schema and a little lost.

The heart of the existing file I am trying to write a schema for 
looks something like this:

<AI00020000 type='faq'>223</AI00020000>
<AI00020001 
type='wiki'>Debugging_Problems_with_APS_Closing_Log_Files</AI00020001>
<AI00020002 
type='wiki'>Doing_Proper_Error_Recovery_for_RawRequestResponse</AI00020002>

So in effect the "element name" is a database key and the set of keys 
is constantly expanding.

Based on my limited understanding of XSD, this cannot be done.

The problem here is that new "elements" are going to be showing up 
all the time.

If the data had been structured like this:

<aitags id='AI00020000' type='faq'>223</aitags>

Then I think I could have made it work and then put a validation on 
"id" to enforce "AI" followed by exactly 8 decimal digits.

However, that I can see, there is no way to declare a "set of 
elements whose names all start with AI followed by 8 decimal digits".

My read of the schema docs suggest XSD just are not setup to do that.

Am I correct?  Or is there some way to describe this without having 
to add something to the XSD file every time a new key is added to the XML file?

Frank
Received on Saturday, 26 April 2008 02:25:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:04 GMT