You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2002/09/22 05:59:08 UTC
DO NOT REPLY [Bug 12897] New: -
System ID is missing inside
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=12897>.
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=12897
System ID is missing inside <!DOCTYPE>
Summary: System ID is missing inside <!DOCTYPE>
Product: Xerces-C++
Version: 1.4
Platform: All
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: DOM
AssignedTo: xerces-c-dev@xml.apache.org
ReportedBy: fangxu99@yahoo.com
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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org