Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XPATH in Schema keyrefs: Do they "understand" substitution groups

From: "Priscilla Walmsley" <nospam@-------.--->
To: NULL
Date: 4/1/2005 2:21:00 PM
Hi David,

The example looks familiar :-).

There is no special support for substitution groups in identity constraint 
XPaths.  You would need to have a selector that is catalog/Shirt | 
catalog/Shoes, or, if all the children of catalog were part of the 
substitution group, you could use catalog/* as your selector.

As far as processors, XQuery and XSLT 2.0 will have some substitution group 
awareness.  For example, in XSLT 2.0 you can create a template whose pattern 
is "schema-element(Product)" and it would match Shirt and Shoes as well. 
Otherwise, I don't know of any special substitution group support in XML 
processors, other than of course XML Schema validators.

Hope that helps,
Priscilla

------------------------------------------------------------------
Priscilla Walmsley
Author, Definitive XML Schema  /  XML in Office 2003
http://www.datypic.com
------------------------------------------------------------------

"David Blickstein" <db@h...> wrote in message 
news:q7e3e.2746$K%2.1791@n......
> Suppose I have an XML Schema that contains a keyref that is part of a
> substitution group.
>
> Let's say I have a "Product" element that contains a field ProductID that 
> is
> a key reference.   The xs:key selector might be "catalog/Product".
>
> Now if I add elements (let's say "Shirt" and "Shoes") that have "Product" 
> as
> a substitution group (they are derived from and can be substituted for
> product) would <Shirt ProductID=34> be considered a keyref (and validated
> accordingly), or would I have to provide a selector that specifically
> matches "Shirt" and "Shoes"?
>
> A second question is... in general... are XML processors that read-in 
> Schema
> generally "aware" of substitution groups?  That is, in general, do I have 
> to
> modify XML apps everytime a new element tag is added to the Product
> substitution group?
>
> Thanks
>
> 




transparent
Print
Mail
Like It
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