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=23100>. 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=23100 getElementById() returns element instance outside document tree Summary: getElementById() returns element instance outside document tree Product: Xerces-C++ Version: 2.3.0 Platform: PC URL: http://http:// OS/Version: Linux Status: NEW Severity: Normal Priority: Other Component: DOM AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] I have a document that uses entity references as a means to include xml from other files. I turn on validation and make sure that it is working by temporarily misspelling a tag in the document and looking for error messages during parseURI(). Now I set doNamespaces to true, CreateEntityReferenceNodes to false and parse my document with validation. This completes without errors. If I walk the DOM tree I can see that it is all correct, with the entity expansion performed, as expected Now I want to generate another view of the tree that requires me to follow IDREFs within my document. Most of the time, the node returned by getElementById() is the correct target node within the tree, but sometimes (4 times out of many in my example below) it returns instead a node which appears to be a clone of the actual target, but turns out to live on a disconnected tree segement with a entity reference as its top parent. This does not seem like the expected behavior. The problem only happens in a tiny minority of calls to getElementById(). The following data will help reproduce the problem. xerces-c build: from xerces-c-src_2_3_0 using runConfigure -plinux -cgcc -xg++ -minmem -nsocket -tnative -rpthread gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110) glibc-2.2.5-42 (build was successful) User method for parsing was copied from samples/DOMPrint (XercesDOMParser). Using DOMBuilder (samples/DOMCount) gives same result. Test document: http://zeus.phys.uconn.edu/halld/geometry/main_HDDS.xml with DTD served from same site. Method to reproduce: 1. Parse the document (either XercesDOMParser or DOMBuilder) with validation, namespaces on, but entityReferenceNodes off; 2. DOMNode* isolatedNode = getElementById(X("CDSI")); 3. while (isolatedNode = isolatedNode->getParentNode()) { cout << isolatedNode->getNodeType() << " " << endl; } 4. note that the top parent has type ENTITY_REFERENCE (5) and not DOCUMENT (9) 5. repeat with IDs ("STRAW", "DC1", "DC2", ...) and see that doc->getElementById() returns a member of the *doc tree. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]