Skip to content

Namespaces in XSLT are not preserved in output #139

Description

@hummingly

This

<?xml version="1.0" encoding="UTF-8"?>
<post>
  <title>Hello World!</title>
</post>
<?xml version="1.0"?> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="post">
		<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB">
			<head>
				<title><xsl:value-of select="title" /></title>
			</head>
			<body>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>

produces with xee xslt command this

<?xml version="1.0" encoding="utf-8"?>
<html lang="en-GB"><head><title>Hello World!</title></head><body/></html>

Notice how the xmlns attribute is missing on the html tag. This is problematic because XHTML files without this namespace are not properly rendered in the browser. The output method xhtml is not supported yet, which is why I just use xml output, but shouldn't it work even for XML?

I tried to debug this myself with copying code from the xee xslt command but the produced Xot returns "" as namespace for the html tag. I am a bit clueless how to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions