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

RE: Compact XPath syntax

Subject: RE: Compact XPath syntax
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 20 Dec 2007 00:39:35 -0000
RE:  Compact XPath syntax
> //c  seems to be what you are looking for.
> 
> In XSLT2, with a schema aware processor, in some limited 
> situations, you may be able to use knowledge of a schema to 
> make such optimsations but in general this is not possible.
> 

Saxon-SA will rewrite //c as /a/b/c provided that the type of the context
node is statically known. It is generally good practice to declare type
information when writing schema-aware stylesheets, for example

<xsl:template match="document-node(schema-element(fpml:FPML))">
  <xsl:value-of select="//x"/>
</xsl:template>

The type information can be used both for optimization and for better error
checking: with a complex schema like FPML, it's very useful to be able to
abbreviate your path expressions (which can otherwise be immensely long)
without incurring any performance penalty.

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

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.