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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: Schema Question

[ Lists Home | Date Index | Thread Index ]
  • From: "Arnold, Curt" <Curt.Arnold@hyprotech.com>
  • To: "'Steven Livingstone, ITS, SENM'" <steven.livingstone@scotent.co.uk>
  • Date: Thu, 2 Dec 1999 09:33:52 -0700

Steven Livingstone wrote
>><element_properties>
>><color>red</color>
>><mixed_with_na>green</mixed_with_na>
>>Is there a way to specify a variable for the element name, but set it's
>>type, say, to string so that any element created under
<element_properties>
>>could be called anything but follow predetermined validation ?


The concepts of archetypes in the W3C Schema draft were motivated (at least
in my interpretation) by the desire to do something like what you suggested.
The classic would be to create an Address archetype and use it to define
ShipTo and Billing elements that have the same content model.

However, this does not allow a document author to make up a new element name
and have the parser mystically figure out it should be an address (or
whatever) and validate it.  The list of all the acceptible elements must be
enumerated in the schema. (I could be wrong my interpretation on this
however).

I guess if you consider an archetype as being an element without a name, you
could allow an archetype to appear in a content model and then any child
element could be validated against the content model.  However, choosing
between two potential archetypes (say in a choice of archetypes or a
sequence with optional archetypes) may require you to look at their content
to determine what archetype applies.  I think this adds too much complexity
to schema validation for its value.

If you really want to do this (and to validate), I think that you let
"element_properties" have any content and then use an XSLT (or something
else) determine if the content of element_properties matches your pattern.

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)






 

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

Copyright 2001 XML.org. This site is hosted by OASIS