473,395 Members | 1,905 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

crashed when casting from DOMNode* to DOMElement*, why?

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));

Jul 17 '07 #1
0 2488

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Subhash | last post by:
Hello, I am trying to generate dynamic graphics using the GD library and TTF fonts. The resulting image shows up fine. But in the apache error_log file the following lines are appended: child...
2
by: petermichaux | last post by:
Hi, I'm trying the following code (ultimately I want a node with a URI like index.php?foo=1&bar) <?php $foo = new DomElement('foo','foo&bar'); ?>
2
by: Avi U | last post by:
I'm creating a DOM document and I'm looking for a way to get an exception when I use ileagal characters. The method DOMElement->createElement() throw exception when I have an ileagal unicode...
2
by: ChrisWinterscheid | last post by:
Occasionally we see these messages in the db2diag.log file. Can someone tell me what they mean and are they anything to worry about? 2005-03-03-10.42.04.286220 Instance:db2inst1 Node:000...
3
by: DavidPL | last post by:
Hello, I have some problem with bind method in PDO on Oracle with clob | long column type. I have table named TEST_TABLE where I have two columns: ID (int 10, 0) and TEXT (varchar 4000 or long...
2
by: KubixKiller | last post by:
Hello, I use the following XML-file to store some useless facts I want to display using PHP. I wrote some PHP code to generate HTML, because I do not have any knowledge of stylesheets etc etc. ...
0
by: Curious | last post by:
A program crashed silently. Fortunately, I was able to get a .dmp file. Hopefully it can provide us with info on why it crashed. When I opened the .dmp file in Notepad, it took a long time to...
1
by: raghulvarma | last post by:
Hai friends, I need to know what would happen when my IIS gets crashed? what would happen to all the projects present inside it?How should I rectify that?What should I do when I am...
3
by: gdczinan | last post by:
given a domnode, how to calcuate the hash of this domnode by using the xerces c++
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.