[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Inserting snippets
Oliver Cope writes: > <snippet name="s1">apples</snippet> > <snippet name="s2">bananas</snippet> > . . . > <p> > I like <insert-snippet name="s1" />, but I hate <insert-snippet > name="s2" />. > </p> > > > ...and I'm looking for an XSL transformation that will give me this: > '<p>I like apples, but I hate bananas.</p>" > <xsl:template match="insert-snippet"> <xsl:value-of select="//snippet[name=current()/@name]"/> </xsl:template> though it would be faster to use <xsl:template match="insert-snippet"> <xsl:value-of select="id(@name)/@name"/> </xsl:template> if <snippet>'s `name' is declared as of type ID in a DTD. an <xsl:template match="snippet"/> will be needed if you run from the top with an apply-templates sebastian XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|