This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Can't get id() and key() to work
- From: Aaron Optimizer Digulla <digulla at hepe dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Sun, 8 Sep 2002 18:25:57 +0200
- Subject: [xsl] Can't get id() and key() to work
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hello,
What I basically need is:
<xsl:variable name="infodoc" select="document('infodoc.xml')"/>
<xsl:variable name="info" select="$infodoc/id($key)"/>
ie. I have an XML document in $infodoc which has IDs and I want to
lookup elements in $infodoc.
I tried to use key() and it actually works but I can't use the
result:
<xsl:variable name="info-fragment">
<xsl:for-each select="$imginfo">
<xsl:copy-of select="key('imgInfoKey', $path-key)"/>
</xsl:for-each>
</xsl:variable>
<xsl:message>info2=<xsl:value-of select="$path-key"/></xsl:message>
<xsl:message>info3a=<xsl:value-of select="exslt:object-type($info-fragment)"/></xsl:message>
<xsl:message>info3b=<xsl:value-of select="count($info-fragment)"/></xsl:message>
<xsl:variable name="info" select="exslt:node-set($info-fragment)"/>
<xsl:message>info4=<xsl:value-of select="$info/@width"/></xsl:message>
<xsl:message>info4b=<xsl:value-of select="exslt:node-set($info-fragment)/@width"/></xsl:message>
This gives:
info2=images/uy-online-left.jpg
info3a=RTF
info3b=1
info4=
info4b=
so apparently there is something in $info-fragment but what?
--
==============================================
Sowatec AG, CH-8330 Pfäffikon (ZH)
Witzbergstr. 7, http://www.sowatec.com
Tel: +41-(0)1-952 55 55
Fax: +41-(0)1-952 55 66
----------------------------------------------
Aaron "Optimizer" Digulla, digulla@sowatec.com
==============================================
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list