S
Son KwonNam
In XSLT, is this possible to get value from xml using XPath
which is in XSLT variable?
I mean XPath strings can be dynamic while XSL Transforming.
If possible, How??
Because I'm not a native English speaker, it's quite hard
to make the problem clear. Please see the following example.
There are two XML files.
One has data, and the other has xpath. I will transform
the XPath XML.
for example,
* XPath XML
<xpaths>
<xpath>/students/student/name</xpath>
<xpath>/students/student/id</xpath>
</xpaths>
* Data XML : data.xml
<students>
<student>
<name>John Doe</name>
<id>234234</id>
</student>
</students>
* XSL snippet.
<xsl:template match="//xpath">
<xsl:variable name="xpathstring" select="."/>
<B>XPaht : <xsl:value-of select="$xpathstring"/></B>
<B>Value : <xsl:value-of select="document('data.xml')/$xpathstring" />
</B> </xsl:template>
As you know, that <xsl:value-of select(document(bla...)/> line
does not
work.
Any solution for this problem in XSLT?
I use JDOM/Xalan for transforming.
Thanks,
which is in XSLT variable?
I mean XPath strings can be dynamic while XSL Transforming.
If possible, How??
Because I'm not a native English speaker, it's quite hard
to make the problem clear. Please see the following example.
There are two XML files.
One has data, and the other has xpath. I will transform
the XPath XML.
for example,
* XPath XML
<xpaths>
<xpath>/students/student/name</xpath>
<xpath>/students/student/id</xpath>
</xpaths>
* Data XML : data.xml
<students>
<student>
<name>John Doe</name>
<id>234234</id>
</student>
</students>
* XSL snippet.
<xsl:template match="//xpath">
<xsl:variable name="xpathstring" select="."/>
<B>XPaht : <xsl:value-of select="$xpathstring"/></B>
<B>Value : <xsl:value-of select="document('data.xml')/$xpathstring" />
</B> </xsl:template>
As you know, that <xsl:value-of select(document(bla...)/> line
does not
work.
Any solution for this problem in XSLT?
I use JDOM/Xalan for transforming.
Thanks,