File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes using variable value inside a variable call ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "using variable value inside a variable call ... " Watch "using variable value inside a variable call ... " New topic
Author

using variable value inside a variable call ...

oLi Bou
Greenhorn

Joined: Jul 03, 2002
Posts: 23
hi all,
I'll try to be as clear as i can :roll:
here is the code :

this is a variable i'd like to access with the xalan:nodeset extension function to be able to access the node values (for ex : $1861005946/bookTitle )
to do this; i need to do the following :

my point is that i need to get this "isbn information" from another .xml file that contains tag like :

so i've made an xsl:variable that looks like this

and i'd like to use the value of $isbn to call the xalan:nodeset.. dunno if ur still following
so i finally would like to use something like this

i've tried

but it doesn(t seems to work ..
if ur still there and understood something, do u plz have an answer ?
==========================
to be clearer :
i have a variable who's value is the name of another variable i need to call ... how do i do that ?
==========================
thx
[ August 22, 2002: Message edited by: oLi Bou ]

--learn every day--
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
from your "this is a variable i'd like to access with the xalan:nodeset extension function to be able to access the node values" I made conclusion you want to be able to query your variable.
By the way, I forgot that XSLT do not convert texts into nodeset so it was a surprise to me. But there is workaround.
Instead of using extension functions, you can use standard document() function. If you call it as document(""), it will return the very stylesheet it is placed in
<xsl:variable name="self" select='document("")'/>
Then you can have access to your data as:
<xsl:value-of select="$self//xsl:variable[@name='1861005946']/bookTitle"/>
But why do you want to do that? To query a variable you define yourself?


Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
Um... It just occured to me that maybe all you want is to read some nodes from another xml? Then it is
<xsl:variable name="books" select="document('books.xml')"/>
<xsl:value-of select="$books/isbn"/>
or whatever you need to access.
oLi Bou
Greenhorn

Joined: Jul 03, 2002
Posts: 23
thanks ...
In fact i do not need it anymore because i decided to implement this in DOM with Java. So i'll be able to popup some DialogBox and tell the user that a book is not referenced, and let him the possibility to reference it directly.
It suits more to my needs finally. But i'm glad to know something i didn't knew yet, thanks
see ya .. oLi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: using variable value inside a variable call ...
 
Similar Threads
XSLT/XPath how to put attribute value in XPath
XSLT - String conversion
Book Promotion and Past Winners in XSLT
returning strings using call-template
XSLT logic