xsl-list
[Top] [All Lists]

[xsl] Merging data on attributes, revisited

2006-08-24 11:33:27
Whoo! I think I managed to work it out on my own. The key and template
on the stylesheet change to...

<xsl:key name="data" match="data" use="@id"/>

(We key on the parent element directly...)

<xsl:template match="svg:text[.=('data')]">
(Look for parent elements with our data placeholder)
        <text>
                <xsl:copy-of select="@*"/>
                <xsl:value-of select="key(.,../@id,doc('textsrc.xml'))"/>

(And then this key (matching to the @id in the parent of our svg:text
element) gives us back the contents of the text file parent element
... which is the values of the children elements)

        </text>
</xsl:template>

Yee-ha! :-)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] Merging data on attributes, revisited, Bob Portnell <=