Re: XSL and processing

Subject: Re: XSL and processing
From: James Clark <jjc@xxxxxxxxxx>
Date: Thu, 03 Sep 1998 14:22:21 +0700
Tomas Eriksson wrote:
> 
> Hello,
> 
> I have a question regarding processing in XSL. I have the following document,
> 
> <root>
>    <pool>
>        <doc identifier="node6">
>            <title>The node title</title>
>        </doc>
>        <doc identifier="node14">
>            <title>The node title</title>
>        </doc>
>    </pool>
>    <relations>
>        <rel>
>             <ref nodeidentifier="node6"/>
>        <rel>
>        <rel>
>             <ref nodeidentifier="node14"/>
>        <rel>
>    </relations>
> </root>
> 
> I would like to process the relations - rel section as a tree (image) and
> after the tree node display the title of the references doc node. I have
> tried the following,
> 
> <xsl:template match="root">
>     <xsl:for-each select="relations/rel/ref">
>         <IMG src="plus.bmp" style="cursor: hand;" align="top"></IMG>
>         <SPAN>
>         <xsl:process
> select="ancestor(root)/pool/doc[attribute(identifier)='{attribute(nodeidenti
> fier)}']/title"/>
>         </SPAN>
>     </xsl:for-each>
> </xsl:template>
> 
> <xsl:template match="root/doc/title">
>         <xsl:process-children/>
> </xsl:template>
> 
>  I am only interested in the doc[identifier]/title matching the ref -
> nodeidentifier value.
> 
> It seems like I am loosing the value of {attribute(nodeidentifier)} when I
> go into a new xsl:process instruction

That won't work because the select attribute of xsl:process isn't
treated as an attribute value template.  In the future you might be able
to do it using something like:

ancestor(root)
 / pool
 / doc[attribute(identifier) = ./attribute(nodeidentifier)]

> Does anyone know how to process and match attribute values the way I want
> to do ? Is it possible with XSL ?

Not yet.

James



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread