Vaduvoiu Tiberiu wrote:
Simple question to the point:
document('/folder/folder2/file.xml')/title work
but if I have a parameter "nm" with the value of "file" or a variable with the name of "nm" with the value of "file" then
document('/folder/folder2/$nm.xml')/title doesn't work. Why doesn't it work?? I tried
googling "document() using parameter" and other ways but I didn't find anything
usefull. Anyone can help me out?? 10x
'/folder/folder2/$nm.xml' is a string containing the '$' dollar sign
(and hence, searches for a file with the name '$nm.xml', which is
apparently not what you want). Luckily, it is not interpreted as a
variable reference! How would the compiler know whether your variable is
$nm, $nm.xml or even something else? You probably want to use concat, or
something similar, which concatenates strings):
document(concat('/folder/folder2/', $nm, '.xml'))/title
Btw, some help for google: use the term "xslt how to concatenate
strings" (without quotes). The first hits explain what you need to know.
Cheers,
-- Abel Braaksma
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--