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

Re: xpath analyser in XSL-T 1 or 2

Subject: Re: xpath analyser in XSL-T 1 or 2
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 2 Apr 2007 15:35:46 +0100
Re:  xpath analyser in XSL-T 1 or 2
> This sounds like a promising approach. When I first saw the address I
> thought it would have something to do with monetDB xquery,

MONET was a EU funded research project for Mathematics ON the WEB, the
project's gone but the web server is still there and NAG was kind enough
to let me use it.

> Do an Xquery with Xpath X, pass Xpath X  to the Xq2xml get back xml,

Yes, that part isn't really me/xq2xml it's a built in feature (which was
added at my request) of the xquery/xpath parsers provided by the working
groups (Scott Boag, mainly)
http://www.w3.org/2005/qt-applets/xqueryApplet.html

from there on. you may not want any of the xq2xml code at all, but just
use MY stylesheets as an example, for example

http://monet.nag.co.uk/xq2xml//index.html#s6

is a stylesheet that removes any references to optional (in xquery) axes
such as preceding::, replacing


$y/preceding::*[2]/string(@i)

by
  $y/
(let $here := . return
   reverse(root()/descendant::*[. << $here][not(descendant::node()[. is $here])]))
[2]/string(@i)

which is essentially just a single template

<xsl:template match="StepExpr[ReverseAxis/data='preceding']">

(let $here := . return
   reverse(root()/descendant::
<xsl:apply-templates select="NodeTest"/>
[. << $here][not(descendant::node()[. is $here])]))
<xsl:apply-templates select="* except (ReverseAxis|NodeTest)"/>
</xsl:template>


David

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.