[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XHTML to XHTML transform
Jeffrey Moss wrote:
I want to create XHTML files and run them through some transforms to turn things Hi, one thing to remember is that XHTML is lowercase. You could do something like this:
<xsl:template match="node()|@*"> <xsl:element name="translate(local-name(), $upper_case, $lower_case)"> <xsl:apply-templates select="@*"/> <xsl:apply-templates/> </xsl:element> </xsl:template> *and* catch any non-compliant elements and convert them to something like: <div class="nonCompliantName"/> You will also want to catch things like empty title, script and textareas and do something like: <xsl:template match="title | script | textarea"> <xsl:choose> <xsl:when test="not(boolean(text()))"> <xsl:element name="translate(local-name(), $upper_case, $lower_case)"> <xsl:apply-templates select="@*"/> <!-- **** --> <xsl:comment/> <!-- **** --> </xsl:element> </xsl:when> <xsl:otherwise> do the same thing as the default template above </xsl:otherwise> </xsl:choose> </xsl:template> best, -Rob
|
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
|