DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12898>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12898

System ID is missing inside <!DOCTYPE>

           Summary: System ID is missing inside <!DOCTYPE>
           Product: Xerces-C++
           Version: 2.1.0
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: DOM
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I did the following (very similar to the CreateDOMDocument example):
1. Create a document type object:
      DOMDocumentType* pDocType = docImpl->createDocumentType(
          X("company"), 0, X("company.dtd"));
2. Create a document object passing the DocType as a parameter:
      DOMDocument* doc = docImpl->createDocument(0, X("company"), pDocType);
3. Add some elements to the document.
4. Create a document writer object:
    DOMWriter* pDOMWriter = docImpl->createDOMWriter();
5. Write the document to string:
       XMLCh *pStr = pDOMWriter->writeToString(*doc);
6. Print out the result string.

Problem: In the result XML string, the system id inside the <!DOCTYPE > is 
missing. The result is like: <!DOCTYPE company>. The correct result should be 
like: <!DOCTYPE company SYSTEM "company.dtd">.

I think the problem is caused by 
DOMDocumentTypeImpl::setOwnerDocument(DOMDocument *doc)
{
    ......
    temp = (XMLCh*) systemId; // cast off const
    systemId = docImpl->cloneString(systemId);
    delete [] temp;

    temp = (XMLCh*) internalSubset; // cast off const
    systemId = docImpl->cloneString(internalSubset);
    delete [] temp;
    ......
}

In the above function, the new internalSubset is overwritting systemId. I think 
it should be assigned to internalSubset instead, like:

    temp = (XMLCh*) internalSubset; // cast off const
    internalSubset = docImpl->cloneString(internalSubset);
    delete [] temp;


Thanks

Fang

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

Reply via email to