Project

Profile

Help

Left xmlns namespace decls in html output

Added by Anonymous about 20 years ago

Legacy ID: #2798187 Legacy Poster: Peter lammich (peterl)

I've the following problem: Given the following stylesheet: <xsl:stylesheet version = "2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2004/07/xpath-functions" xmlns:test="test" exclude-result-prefixes="fn xs test" > <xsl:output method="html"/> <xsl:template match="/"> <html><body><xsl:sequence select="*"/></body></html> </xsl:template> </xsl:stylesheet> and the following input file: <h1 xmlns:test="test"> This is a headline </h1> I get the following output: <html> <body> <h1 xmlns:test="test"> This is a headline </h1> </body> </html> The problem is the xmlns:test namespace declaration, it should not occur in html output. How can I get rid of this declaration. It always occurs when I copy elements from the input (with the namespace in scope) to the (html) output. Is there a way to tell saxon to remove the unused namespace declarations ? thanks in advance --peter


Replies (1)

RE: Left xmlns namespace decls in html output - Added by Anonymous about 20 years ago

Legacy ID: #2798237 Legacy Poster: Michael Kay (mhkay)

Try replacing <xsl:sequence select=""/> with <xsl:copy-of select="" copy-namespaces="no"/> Michael Kay

    (1-1/1)

    Please register to reply