M
Meal
The last line of the following codes makes the program crash.
I cannot debug into the codes. It looks that I cannot use the
dynamic_cast, but why?
The cout shows that the node is DOM element node. I think it's
possible to cast it from DOMNode* to DOMElement*.
I need the cast to use method getElementsByTagName() which DOMNode
doesn't have.
XMLCh* tagTuple = XMLString::transcode("tuple");
DOMNodeList * listTuple = doc->getElementsByTagName(tagTuple);
XMLString::release(&tagTuple);
if(listTuple->getLength()==0)
{
return;
}
//For the first tuple
cout<<listTuple->item(0)->getNodeType()<<endl;
DOMElement* tuple = dynamic_cast<DOMElement*>(listTuple->item(0));
I cannot debug into the codes. It looks that I cannot use the
dynamic_cast, but why?
The cout shows that the node is DOM element node. I think it's
possible to cast it from DOMNode* to DOMElement*.
I need the cast to use method getElementsByTagName() which DOMNode
doesn't have.
XMLCh* tagTuple = XMLString::transcode("tuple");
DOMNodeList * listTuple = doc->getElementsByTagName(tagTuple);
XMLString::release(&tagTuple);
if(listTuple->getLength()==0)
{
return;
}
//For the first tuple
cout<<listTuple->item(0)->getNodeType()<<endl;
DOMElement* tuple = dynamic_cast<DOMElement*>(listTuple->item(0));