DOMWriter fails to emit default namespace under some circumstances
------------------------------------------------------------------

         Key: XERCESC-1371
         URL: http://issues.apache.org/jira/browse/XERCESC-1371
     Project: Xerces-C++
        Type: Bug
  Components: DOM  
    Versions: 2.5.0, 2.6.0    
 Environment: Visual Studio .NET 2003 on Windows XP
    Reporter: Jesse Pelton
 Attachments: CreateDOMDocument.cpp

I've modified the CreateDOMDocument sample to use createElementNS() rather than 
createElement() to create and serialize a document like the following:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<company xmlns="NSOne">
  <product xmlns="NSTwo">Xerces-C
    <foo xmlns="NSOne"/>
  </product>
  <category idea="great">XML Parsing Tools</category>
  <developedBy>Apache Software Foundation</developedBy>
</company>

DOMWriter omits the namespace from the "foo" element, so the program emits the 
following (some blank lines removed):

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<company xmlns="NSOne">
  <product xmlns="NSTwo">Xerces-C
    <foo/>
  </product>
  <category idea="great">XML Parsing Tools</category>
  <developedBy>Apache Software Foundation</developedBy>
</company>

The problem appears to occur when an element's default namespace URI is also 
used by an ancestor, but an intervening ancestor has a different default 
namespace URI.

I suspect that versions 2.3 and 2.4 are also affected.

I'll attach the modified sample.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to