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

XSLT functions in XPath

Subject: XSLT functions in XPath
From: Victor Toni <xsl-list@xxxxxxxxx>
Date: Mon, 09 Oct 2006 19:57:09 +0200
xslt functions today
Hello All,

I am working on an XSLT-like project, which uses XPath expression to
retrieve data from an XML source and writes the results into a resulting
data structure.

XPath evaluation may be dependent on the results of previous
evaluations, for example

contextA = //author[@name = 'someName']
contextB = //book[@isbn] using contextA

I am using the Saxon XPath implementation over DOM to take advantage of
the XPAth 2.0.
This works really well most of the time (the time when I am not missing
anything), however I would like to have access to two more functions
which would be really helpful:

current()
sort()

Is it somehow possible to use current() in "normal" XPath, an example:

contextA = //@isbn = '1234567'
contextB = //author[books/book/@isbn = current() ] using contextA

(I know that I could use a VariableResolver but this would be a bit over
the top of what I would like to do and I would have to change the syntax
of my currently really trivial configuration files ;-) )

In XSLT one can sort a nodeset by providing additional XPath expression.
Prior to Saxon I used Jaxen and wrote me an extension function which
could basically do something like

sort-by(//author, '@name', '@forename')
or
sort-by(//book, 'number(@year)')

Since Saxon has many more extension functions I wondered if I could use
the its XSLT functionality somehow for this task.

Any hints are much appreciated.

Kindest regards,
Victor

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.