This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

namespace scope


I am doing an XML to XML copy and need to add a few new elements.
The copy is fine but why are my added elements outputted with 2 xmlns
attributes?

An empty one and an our namespace. I have definined it at the top in
xls:stylesheet.
xmlns=""
xmlns:nol="urn:nollekens.be"

I tried to include a the parts that seems import to explain the problem

The input XML file
<?xml version="1.0"?>
<root xmlns="urn:nollekens.be">
...
  <offertelijn>
  ...
  </offertelijn>
</root>

XLST stylesheet looks like this

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:nol="urn:nollekens.be">
...
<xsl:template match="nol:offertelijn">
  <xsl:copy>
    ...
    <xsl:choose>
      <xsl:when test="nol:referteklant = ''">
        <mutcode>NEW</mutcode>
      </xsl:when>
      <xsl:otherwise>
        <mutcode>MOD</mutcode>
      </xsl:otherwise>
    </xsl:choose>

  </xsl:copy>
</xsl:template>

output XML file (copied fields are exact like in my source XML )
but the added fields have the 2 ns attributes
   <mutcode xmlns="" xmlns:nol="urn:nollekens.be">MOD</mutcode>

Thanks for any feedback,
Joeri



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]