I have two XML files. One is the main XML file and the other one is used as a lookup table. Here is the main XML:
This is the way I would do it (although I like Martin's use of xsl:key):
I modified main.xml and lookup.xml to show the dynamic name lookup.
main.xml
test1
test2
test3
testing new element
test4
test5
test6
testing new element again
lookup.xml
fieldA
fieldB
fieldC
fieldD
XSLT 1.0 stylesheet
-
output
-
test1
test2
test3
testing new element
-
test4
test5
test6
testing new element again