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=4544>.
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=4544

IDOM_NodeList::getLength incorrect when called twice for empty list

           Summary: IDOM_NodeList::getLength incorrect when called twice for
                    empty list
           Product: Xerces-C++
           Version: 1.5.2
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: DOM
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


A problem occurs when I call getElementsByTagName for an element that does not 
exist. The first call correctly returns a nodelist with a length of 0. A second 
call returns a nodelist with a length of 1. Examination of the node in the list 
reveals that it points to the original element from which the 
getElementsByTagName was called. Here is an example:

<member name="bob">
</member>

IDOM_Document * pMemberDoc;
IDOM_Element * pMemberRoot;
IDOM_Element * pElement;
IDOM_NodeList * pNodeList;
IDOM_Node * pNode;
long len, type;
_bstr_t b;

pMemberDoc = parser->getDocument();
pMemberRoot = pMemberDoc->getDocumentElement();
pNodeList = pMemberRoot->getElementsByTagName(L"Bogus");
len = pNodeList->getLength(); // len = 0 after this call
len = pNodeList->getLength(); // len = 1 after this call
pNode = pNodeList->item(0);
type = pNode->getNodeType(); // type = 1 after this call (element)
b = pNode->getNodeName(); // b = "member" after this call

I'm guessing that the first call to getLength() hoses things up some internal 
pointers. Thanks in advance for your help.

Claude

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

Reply via email to