Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 12th, 2007, 10:22 AM
Registered User
Join Date: May 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default string to x-path - EXSLT - dynamic functions


I want to define a list of variables of elements on the top of the xslt file, which are used in the xslt. So that it becomes simpler to change the element names. But the template match statement of xslt expects a X-Path as type and so this isn't possible.

So what i want to do:
<xsl:variable name="test">element</xsl:variable>
<<xsl:template match="$test">

Is their any possibility to convert String to X-Path. I have searched a little bit and found EXSLT, which extends XSLT. This extention includes some dynamic functions, which allow to convert String to X-Path. But not all Parser implement this extention. Currently i use the Parser XALAN in Java but i've read that this Parser doesn't support the dynamic functions. I also tried it out, but it doesn't work.

Is their any other solution to convert Strings to X-Path? Or can someone recommend me a Parser which supports the dynamic functions and can be used in Java?


Old July 12th, 2007, 10:35 AM
mhkay's Avatar
Wrox Author
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts

I believe that Xalan has a xalan:evaluate() extension; and Saxon certainly has saxon:evaluate(). However, these can only be used in an XPath expression context, whereas you seem to be trying to construct an XSLT pattern dynamically. As far as I'm aware that's not possible.

Michael Kay
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference

Similar Threads
Thread Thread Starter Forum Replies Last Post
String functions in classic asp nit115 Classic ASP Basics 1 May 23rd, 2007 08:10 PM
Math Functions on dynamic data jroxit Classic ASP Basics 3 January 23rd, 2007 12:07 PM
Print a string along a Path dparsons ASP.NET 1.0 and 1.1 Professional 1 July 12th, 2006 12:24 PM
String functions..... BlueStag VB.NET 2002/2003 Basics 1 June 10th, 2005 05:58 AM
XPath: String functions question. pupu79 XSLT 4 January 10th, 2005 03:00 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.