|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Embedding html within xml
> -----Original Message-----
> From: John Reid
>
> I like that idea copy-of. But have not yet got it to work
>
Hi,
I guess ultimately the most elegant way to deal with it would be to provide
a few basic templates like
<xsl:template match="rule">
<li class="strong"><xsl:value-of selecy="@type" /><br/>
<span class="goldmedium"><xsl:apply-templates select="node()" /></span>
</li>
</xsl:template>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
then, this
> <ul>
> <xsl:for-each select="rules/rule">
> <li class="strong"><xsl:value-of select="@type" /><br/>
> <span class="goldmedium"><xsl:value-of select="."
> /></span></li>
> </xsl:for-each>
> </ul>
>
becomes simply
<ul><xsl:apply-templates select="rules/rule" /></ul>
and, no matter what other nodes are nested in there somewhere, they will
always be copied along in the correct order.
Hope this helps!
Cheers,
Andreas
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
|

Cart








