• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

using variable value inside a variable call ...

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Mapraputa Is
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic