- From: Michael Kay <mike@saxonica.com>
- Date: Sat, 26 Apr 2008 08:20:12 +0100
- To: "'Frank Merrow'" <fmerrow@qualcomm.com>, <xmlschema-dev@w3.org>
- Message-ID: <D3ABB048B2BF45E1A57BE439EAB550D7@Sealion>
Generally, that's not a good way of designing your XML, which explains why there is no way of describing your design in XML Schema. It's best to use element and attribute names to denote types, and element or attribute values to contain instance data. Michael Kay http://www.saxonica.com/ _____ From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On Behalf Of Frank Merrow Sent: 25 April 2008 21:45 To: xmlschema-dev@w3.org Subject: Schema Newbie Boxed in a corner . . . 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 07:20:49 UTC