[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: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Thu, 27 Mar 2008 17:34:39 +0530
Re:  XPath 2.0 Best Practice: wrap the first node of ev
Hi Roger,
   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>

But your suggestion to ask for a better error reporting looks good to
me (as implemented by Saxon).


On 3/27/08, Costello, Roger L. <costello@xxxxxxxxx> wrote:
> David Carlisle wrote:
>
> > That seems a fairly harsh statement given that there is absolutely
> nothing
> > in the XSLT specification that suggests that a warning should be
> raised
> > for this expression.
>
> > It may be that you think that the expression should be in error, but
> in
> > that case your complaint should be with the XSLT Working Group who
> > specified it
>
> Thanks David.  You're right.  Okay, I just sent the below message to
> public-qt-comments@xxxxxx
>
> ---------------------------------------------------------
>
> [XPath] Request XPath implementations be required to do some static
> type checking on the schema-element function
>
> Hi Folks,
>
> I would like to request a small change to the XPath 2.0 specification.
>
> I would like to request that XPath implementations be required to
> generate an error or warning message for expressions like this:
>
>    schema-element(Book)/Foo
>
> where Foo is not a valid child of Book, according to the in-scope
> schema.
>
> Further, implementations be required to generate an error or warning
> message for expressions like this:
>
>   schema-element(Book)/Author/FirstNam
>
> where, according to the in-scope schema, Author is a valid child of
> Book but FirstNam (note that I misspelled Name) is not.
>
> Thank you very much for your consideration.
>
>  -- Roger L. Costello


-- 
Regards,
Mukul Gandhi

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