Mark Stanton wrote:
> Could you convert:
>
> <window>
> <titlebar>mycontent</titlebar>
> <content>mycontent</content>
> </window>
>
> into:
>
> <div class="window">
> <div class="titlebar">mycontent</div>
> <div class="content">mycontent</div>
> </div>
>
> using XSL?
>
> <window>
> <titlebar>mycontent</titlebar>
> <content>mycontent</content>
> </window>
>
> into:
>
> <div class="window">
> <div class="titlebar">mycontent</div>
> <div class="content">mycontent</div>
> </div>
>
> using XSL?
Mark (and Scott),
not having noticed the original post I'm a bit out of the loop
on this discussion, but the Xsl below does the transformation with the fewest of
lines of code possible.
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes"
encoding="utf-8"/>
<xsl:template match="window | titlebar |
content">
<div class="{name()}">
<xsl:apply-templates/>
</div>
</xsl:template>
<div class="{name()}">
<xsl:apply-templates/>
</div>
</xsl:template>
</xsl:stylesheet>
woric
PS: If you need a Xsl transformation tool and are using a
ASP.NET box try XsltFilter (http://xsltfilter.tigris.org). If you are using
Linux there are lots of Xslt tools for apache and
java.