XSLT Extension Object returns empty default namespace

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon_Keep@hotmail.com

    #1

    XSLT Extension Object returns empty default namespace

    Hi,

    I have an Xslt extension object that returns a node-set to the xslt
    stylesheet which then uses an xsl:copy-to statement to write it to the
    output.

    The problem I am having is that the copied elements appear with an
    empty default namespace appearing on them (xmlns=""). The root element
    of the output XML does declare a default namespace
    (xmlns="urn:sch emas-microsoft-com:office:spre adsheet").

    I have tried adding the same default namespace to the root node
    returned by the extension object but it still appears as an empty
    string in the output XML.

    Can anybody help?

    Thanks,
    Si.

  • Martin Honnen

    #2
    Re: XSLT Extension Object returns empty default namespace



    Simon_Keep@hotm ail.com wrote:

    [color=blue]
    > I have an Xslt extension object that returns a node-set to the xslt
    > stylesheet which then uses an xsl:copy-to statement to write it to the
    > output.[/color]

    xsl:copy-to? I guess you use xsl:copy-of.
    [color=blue]
    > The problem I am having is that the copied elements appear with an
    > empty default namespace appearing on them (xmlns=""). The root element
    > of the output XML does declare a default namespace
    > (xmlns="urn:sch emas-microsoft-com:office:spre adsheet").[/color]

    xsl:copy-of simply copies the node(s) to the result tree, it does not
    matter which namespace the root element has, your extension object has
    to create the elements in the intended namespace.
    [color=blue]
    > I have tried adding the same default namespace to the root node
    > returned by the extension object but it still appears as an empty
    > string in the output XML.[/color]

    We need to see exactly how you are creating the nodes in the extension
    object then to figure what goes wrong.

    --

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/

    Comment

    • Simon_Keep@hotmail.com

      #3
      Re: XSLT Extension Object returns empty default namespace

      Hi Martin,

      I think I have fixed it.

      I was adding the namespace as an attribute to the root node instead of
      specifying it as the namespaceURI when calling the CreateElement
      method.

      Thanks anyway for your prompt reply.

      Si.

      Comment

      Working...