cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Lanch <>
Subject Re: Template problem
Date Wed, 08 Mar 2000 18:43:26 GMT wrote:
> Hi friends
> I have a document which looks more or less like this:
> <question id="in1">
> <text>Hallo?</text>
> </question>
> I have create using DOM an element called "in1".What i want to do is as
> follows:
> <xsl:template match="text">
>        <xsl:variable name="reply">
>            <xsl:value-of select="../@id"/>
>         </xsl:variable>
>         <xsl:variable name="reply1">
>              <xsl:value-of select="../$reply"/>

i think it works if you change the previous line to-

<xsl:value-of select="../*[name() = $reply]"/>

-or to-

<xsl:value-of select="../*[name() = ../@id]"/>

-(which makes the first variable unnecessary).

>          </xsl:variable>
> </xsl:template>
> That is, i want to acces to the value of the element "in1" but not
> directly. First getting the name of the element from the attribute "id"
> of the element "question" and after use the value of "id" in a patten
> for acces to the value of the "in1" element.




"How did you enjoy yourself with these people?
Answer: very much, almost as much as I do when alone."

View raw message