Namespace declaration from source document appears in target document.

  • Thread starter Mads Orbesen Troest
  • Start date
M

Mads Orbesen Troest

Hi,

If I have an XSLT sheet transforming elemens from the "myns" namespace
into xhtml, the "myns" namespace is declared automatically in the
output xhtml, even if not used. I can't seem to figure out why and how
to get rid of it.

The top of my XSLT file:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:myns="http://myns.org"<xsl:eek:utput
method="xml"
version="1.0"
encoding="UTF-8"
indent="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"

doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
/>

The generated xhtml file is fine except I'd like to get rid of that
myns-declaration:
<html xmlns:myns="http://myns.org">

How do I do that?

Thanks in advance,
/\/\\ads Orbesen Troest

(This is a corrected repost of a now cancelled message.)
 
M

Martin Honnen

Mads said:
If I have an XSLT sheet transforming elemens from the "myns" namespace
into xhtml, the "myns" namespace is declared automatically in the
output xhtml, even if not used. I can't seem to figure out why and how
to get rid of it.

The top of my XSLT file:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:myns="http://myns.org"

Use
<xsl:stylesheet exclude-result-prefixes="myns"
xmlns:xsl="..."
xmlns:myns="..."
version="1.0">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top