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 June 23rd, 2006, 03:00 AM
TPP TPP is offline
Authorized User
 
Join Date: Mar 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default value from a xml path in a variable ??

Hi! I have a xml path in a variable and when i want to get a value of the node i get 'path'

How could i get the value?

Thanks, T.

Code:
<xsl:variable name="SZ" select="//n:Envelope/x:body/x:RE/x:RE_1d/x:Ive" />
<xsl:value-of select="$SZ" />
output:
//ns2:Envelope/x:body/x:RE/x:RE_1d/x:Ive
 
Old June 23rd, 2006, 03:09 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

I think you must have had quotes around the path as in
Code:
<xsl:variable name="SZ" select="'//n:Envelope/x:body/x:RE/x:RE_1d/x:Ive'" />
or possibly you're passing a string as an input parameter otherwise it would work.

In general what you want though is not possible under standard XSLT.
Some processors, Saxon for example, provide an evaluate extaension to cope with this otherwise you can write an extension using script if you're using MSXML, .NET if using .NET XSL or Java for other Java based processors.

--

Joe (Microsoft MVP - XML)
 
Old June 23rd, 2006, 03:11 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Your variable SZ does not contain a path, it contains the node-set obtained by evaluating that path.

It might be helpful to supply a complete (though small) stylesheet and source document that demonstrates what you want to achieve.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use variable in path? Shinji XSLT 2 September 18th, 2008 09:08 AM
SQL Server 2005 XML: FOR XML PATH -> cdata? stoves SQL Server 2005 1 July 8th, 2008 02:40 AM
Variable Path in web.Config Connection String? ElPato General .NET 4 June 21st, 2004 05:44 PM
Appending to PATH environment variable jacob C# 1 February 9th, 2004 10:43 AM





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