xsl-list
[Top] [All Lists]

RE: How To Execute an x-path statement stored insode an variable ?

2004-06-16 07:59:39
From: Jan Kohnert [mailto:J(_dot_)Kohnert(_at_)swisslab(_dot_)de] 

I have stored x-pathes inside an varibale:

<xsl:variable name="GetItem">
  <!-- Statische Items -->
  <item name="NAME" select="BOOK/@name"/>
  <item name="ISBN" select="BOOK/@isbn"/>
      ...
</xsl:variable>


The Idea is to store the x-path inside an variable, because 
if the XML changes, I dont want to rewrite alle my 
stylesheets. All I have to do is to change the contant of the 
variable.


This kind of question has just been discussed over the last day or so on
the thread "including string of value in xpath-path".

Adding to the replies in that thread, one approach is to write a
stylesheet tha takes your path expressions and writes a second
stylesheet containing the paths.  You use the second stylesheet to
perform the actual transformation you are after.

Look to the various FAQs for help in doing this (or search the list
archives).

Cheers,

Tom P


<Prev in Thread] Current Thread [Next in Thread>