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

RE: Why is XPath2 being so explicit about types of substitutio

  • To: "'Soren Kuula'" <dongfang@d...>,<xml-dev@l...>
  • Subject: RE: Why is XPath2 being so explicit about types of substitution grp members?
  • From: "Michael Kay" <mike@s...>
  • Date: Wed, 8 Feb 2006 10:01:30 -0000
  • In-reply-to: <43E96228.2080305@d...>
  • Thread-index: AcYsVbu5brNVrvCwQ4+V7clmIwaZLAAQHcdQ

php xpath2

The problem is that you can have a valid element named S which doesn't
conform to the definition of the global element declaration S, because of
the existence of a local element called S with an unrelated type. So the
fact that an element is named S and is valid doesn't prove that it conforms
to the type of the global element declaration S: hence the need for rule 2.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: Soren Kuula [mailto:dongfang@d...] 
> Sent: 08 February 2006 03:15
> To: xml-dev@l...
> Subject:  Why is XPath2 being so explicit about 
> types of substitution grp members?
> 
> Hi,
> 
> As I understand it, XML Schema substitution grp members 
> always must have 
> a type that is derived from that o the head:
> 
> "
> All such members must have type definitions which are either 
> the same as 
> the head's type definition or restrictions or extensions of it. 
> Therefore, although the names of elements can vary widely as new 
> namespaces and members of the substitution group are defined, the 
> content of member elements is strictly limited according to the type 
> definition of the substitution group head.
> "
> 
> Cool, but there must be a reason for the XPath2 spec to reapeat that? 
> schema-element:
> 
>    1.
> 
>       The name of the candidate node matches the specified ElementName
>       <http://www.w3.org/TR/xpath20/#doc-xpath-ElementName> or matches
>       the name of an element in a substitution group
>       <http://www.w3.org/TR/xpath20/#dt-substitution-group> 
> headed by an
>       element named ElementName
>       <http://www.w3.org/TR/xpath20/#doc-xpath-ElementName>.
> 
>    2.
> 
>       |derives-from(|/AT, ET/|)| is |true|, where /AT/ is the type
>       annotation of the candidate node and /ET/ is the schema type
>       declared for element ElementName
>       <http://www.w3.org/TR/xpath20/#doc-xpath-ElementName> in the
>       in-scope element declarations
>       <http://www.w3.org/TR/xpath20/#dt-is-elems>.
> 
>    3.
> 
>       If the element declaration for ElementName
>       <http://www.w3.org/TR/xpath20/#doc-xpath-ElementName> in the
>       in-scope element declarations
>       <http://www.w3.org/TR/xpath20/#dt-is-elems> is not |nillable|,
>       then the |nilled| property of the candidate node is |false|
> 
> Is #2 really necessary here? It's about type _annotations_ all right, 
> but as I understand it these must be consistent with the XML schema 
> types in this respect anyway...
> 
> I'm probably just overlooking something, just puzzled...
> 
> Soren
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
> 
> 



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.