Subject: [xsl] unwanted xmlns and shape attributes From: Manfred Staudinger <manfred.staudinger@xxxxxxxxx> Date: Fri, 9 Sep 2005 15:35:46 +0200 |
Hi list, I have two temporary trees to be used for an identity transformation. The first one $html is initialized with <xsl:copy-of select="doc('itrans.html')"/> the second one with a sequence constructor. The transformation inserts an anchor element before the one existing already. It finally works somehow, but I've still two problems (using Saxon 8.5.1): a. The inserted anchor shows xmlns="" as an attribute, but how do I to get rid of it? I know that specifying a default nemespace xmlns="http://www.w3.org/1999/xhtml" on the stylesheet would solve the issue. However this seems to have a devastating effect on my original stylesheet and I would like to avoid it. b. The second anchor shows a shape="rect" attribute, which is not in the source and again the question is how do I to get rid of it? Regards, Manfred Input file itrans.html: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>hhh</title> </head> <body> <div class="index"> <a href="Index.html">Personen-Index</a> </div> </body> </html> <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xhtml" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" omit-xml-declaration="yes" /> <xsl:template match="node()|@*" mode="index"> <xsl:param name="a"/> <xsl:copy copy-namespaces="no"> <xsl:apply-templates select="node()|@*" mode="index"> <xsl:with-param name="a" select="$a"/> </xsl:apply-templates> </xsl:copy> </xsl:template> <xsl:template xpath-default-namespace="http://www.w3.org/1999/xhtml" match="a" mode="index"> <xsl:param name="a"/> <xsl:copy-of select="$a" copy-namespaces="no"/> <xsl:copy-of select="."/> </xsl:template> <xsl:template match="/"> <xsl:variable name="html"> <xsl:copy-of select="doc('itrans.html')"/> </xsl:variable> <xsl:variable name="link"> <a href="../name.html"> <xsl:text>name</xsl:text> </a> </xsl:variable> <xsl:apply-templates select="$html" mode="index"> <xsl:with-param name="a" select="$link"/> </xsl:apply-templates> </xsl:template> </xsl:stylesheet>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] CSV to XML, Tony Lavinio | Thread | Re: [xsl] unwanted xmlns and shape , David Carlisle |
Re: [xsl] xhtml to rtf stylesheet, Maximilian Gärber | Date | Re: [xsl] CSV to XML, George Cristian Bina |
Month |