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

Re: XPath 2.0 Best Practice: wrap the first node of ev

Subject: Re: XPath 2.0 Best Practice: wrap the first node of every path expression within schema-element?
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Thu, 27 Mar 2008 13:41:13 +0100 (CET)
Re:  XPath 2.0 Best Practice: wrap the first node of ev
Mukul Gandhi wrote:

  Hi

>    For this case, some form of static error reporting is already
> defined in the XPath 2.0 spec. Please see:

> http://www.w3.org/TR/xpath20/#id-schema-element-test

> <quote>
> schema-element(ElementName)

> If the ElementName specified in the SchemaElementTest is not found in
> the in-scope element declarations, a static error is raised
> [err:XPST0008].
> </quote>

  That is not the same thing.  In the Roger's suggestion, you set up
the static type of a step in a path (for instance explicitely, via a
variable, or in the initial context if the path is in an XSLT template
rule with schema-element as pattern.)

  Knowing on the one hand the static type at one step, and on the other
hand the schema, the processor is able to deduce the possible steps
(according to the schema) for most of the following steps (depending on
the schema and the following steps themselves.)

  And in order to use schema-element, you must have a global element in
the schema.  For instance:

    <xs:element name="author" type="author.type"/>

    <xs:complexType name="author.type">
       <xs:sequence>
          <xs:element name="first-name" type="xs:string"/>
       </xs:sequence>
    </xs:complexType>

  How could you be sure the processor will check that 'first-name' is
not misspelled in the following expression:

    schema-element(author)/first-name

?

  Regards,

--drkm
























      _____________________________________________________________________________ 
Envoyez avec Yahoo! Mail. Capaciti de stockage illimitie pour vos emails. http://mail.yahoo.fr

Current Thread

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
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-2007 All Rights Reserved.