Namespace declaration from source document appears in target document.

Discussion in 'XML' started by Mads Orbesen Troest, Apr 19, 2004.

  1. 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.)
    Mads Orbesen Troest, Apr 19, 2004
    #1
    1. Advertising

  2. Re: Namespace declaration from source document appears in targetdocument.

    Mads Orbesen Troest wrote:
    > 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">



    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Apr 20, 2004
    #2
    1. Advertising

  3. Martin Honnen wrote:

    > Use
    > <xsl:stylesheet exclude-result-prefixes="myns"


    Ah, excellent, thanks a lot! :)

    /\/\\ads Orbesen Troest
    Mads Orbesen Troest, Apr 20, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. The Dana's
    Replies:
    5
    Views:
    1,872
    Dylan Parry
    Feb 5, 2005
  2. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,251
    Stanimir Stamenkov
    Apr 25, 2005
  3. swetha
    Replies:
    3
    Views:
    531
    swetha
    Dec 2, 2007
  4. mohit
    Replies:
    0
    Views:
    554
    mohit
    Jan 23, 2008
  5. The Dana's
    Replies:
    3
    Views:
    144
    The Dana's
    Feb 5, 2005
Loading...

Share This Page