Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: problem with xhtml-tags after transformNode

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 4/11/2008 1:04:00 PM

Joerk wrote:

> <xsl:for-each select="Rechtsmittel">
>   <span style="font-family:Arial; font-size:12pt; ">

As your 'Rechtsmittel' element can contain arbitrary XHTML I would not 
use a 'span' element as the container, rather a 'div' element. But that 
is more a question of proper HTML use and not of XML/XSLT.

>     <xsl:apply-templates />
>   </span>
> </xsl:for-each>

The xsl:apply-templates is fine but you also need templates to process 
any elements in the XHTML namespace e.g.
   <xsl:template match="xhtml:*"
                 xmlns:xhtml="http://www.w3.org/1999/xhtml">
     <xsl:element name="{local-name()}" namespace="">
       <xsl:apply-templates select="@* | node()"/>
     </xsl:element>
   </xsl:template>
and for attributes
   <xsl:template match="xhtml:*/@*"
                 xmlns:xhtml="http://www.w3.org/1999/xhtml">
     <xsl:copy/>
   </xsl:template>

The first template above takes XHTML elements and transforms them to 
HTML elements in no namespace. Alternatively if you want your stylesheet 
to create XHTML you could use xsl:copy-of
   <xsl:template match="xhtml:*"
                 xmlns:xhtml="http://www.w3.org/1999/xhtml">
     <xsl:copy-of select="."/>
   </xsl:template>

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent