473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

xslt eval concat xpath

Hello.

I need to select a Xpath that consists of a path plus a variable.
Like this:
<xsl:value-of select="concat($path, $num)" />
The above will return the concatenated string and not the value from
the xpath.

So I guess I need something like <xsl:value-of
select="eval(concat($path, $num))" /but can not make it work.

Any ideas?

/jacob

Oct 26 '07 #1
1 4973

webjay <ja***********@gmail.comwrote in
<11*********************@v3g2000hsg.googlegroups.c om>:
I need to select a Xpath that consists of a path plus a
variable. Like this:
<xsl:value-of select="concat($path, $num)" />
The above will return the concatenated string and not the
value from the xpath.

So I guess I need something like <xsl:value-of
select="eval(concat($path, $num))" /but can not make it
work.
You can't do that with XSLT1. EXSLT provides dyn:evaluate(),
but it's non-standard. Therefore processor support may
vary, up to and including blowing up your freezer when you
try to invoke it.

Please note that a need for eval() often indicates a design
problem or taking the wrong turn while trying to solve your
actual problem. If you restated your problem in terms
of 'what-I-need-to-achieve' instead
of 'what-functionality-I-need-in-the-language' denizens of
the group might be able propose a more elegant solution.

--
It is rare to find learned men who are clean, do not stink,
and have a sense of humour. -- Liselotte in a letter to
Sophie, 30 Jul 1705
Oct 26 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Patrick Reilly | last post by:
I am trying to implement a better method than I already have to document database schemas with XML, and use XSLT to both generate database DDL statements (CREATE TABLE, etc) and to transform to...
2
by: Peter Gerstbach | last post by:
Hi, I want to convert with XSLT/XPATH a String like "Aaa bbb ccc" with variant length into to "AaaBbbCcc". I think it should be possible with these steps: 1) tokenize the String with ' ' as...
4
by: Son KwonNam | last post by:
In XSLT, is this possible to get value from xml using XPath which is in XSLT variable? I mean XPath strings can be dynamic while XSL Transforming. If possible, How?? Because I'm not a...
4
by: Gerald Aichholzer | last post by:
Hello, I need to specify the following attribute in an xhtml-file containing TAL templates: <div tal:attributes="onMouseOver concat('func(',xyz,')')"> which results in <div...
0
by: Jay Allard | last post by:
Hello I posted this in the vb.net group on the 2/25/2004, but didn't get any response. Here's attempt 2. Does anyone know of a more appropriate place to post this? One new piece of...
7
by: mike p. | last post by:
I have a docbook xml file, and am using standard docbook 1.61.3 xsl stylesheets to do xhtml transform. Transform works fine when using MSXML. When I try to do the following using asp.net 1.1: ...
0
by: david.paik | last post by:
Given the data: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="C:\junk\830new.xslt"?> <SC830> <SC830_3 bano="S67777" cuno="002620" year="2007" week="38"...
3
by: Carles Company Soler | last post by:
Hello, I want to calculate the value of an attribute. For example <rect x="2+3" y="12"and be <rect x="5" y="12">. Is it possible using XSLT? Thanks!
8
by: Hercules Dev. | last post by:
Hi all, I'm new in xslt and xpath, so my question might be simple but i'm learning. I have an XML document and need to transform it into another XML, I use xslt and it works, but there is a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.