Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] xpath analyser in XSL-T 1 or 2

From: David Carlisle <davidc@--------->
To:
Date: 4/2/2007 2:36:00 PM
> 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent