[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Schema Question

  • From: "Arnold, Curt" <Curt.Arnold@h...>
  • To: "'Steven Livingstone, ITS, SENM'" <steven.livingstone@s...>
  • Date: Thu, 2 Dec 1999 09:33:52 -0700

any child element
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@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.