Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Cand XSLT evaluate XPath in String variable?

From: Son KwonNam <kwon37xi@------.--->
To: NULL
Date: 1/4/2005 10:54:00 PM
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,


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent