Daniel Burrell wrote:
When reading this xml file
<collection>
 <description/>
 <recipe/>
 <svgfile name="D:\svg.svg">test</svgfile>
</collection>

for some reason line 1 outputs "svgfile" to the screen, yet line 3 is never
printed.

1) cout << XMLString::transcode(nd->getNodeName())<<endl;
2) if (nd->getNodeName() == XMLString::transcode("svgfile")) {
3) cout << "===========================================================";
This code results in a memory leak. Please read the documentation for XMLString::transcode().

this doesn't work either:

1) cout << XMLString::transcode(nd->getNodeName())<<endl;
2) if (XMLString::transcode(nd->getNodeName()) == "svgfile") {
3) cout << "===========================================================";

You're comparing two pointers, which is not what you want to do. Use the C run-time library function strcmp() or use XMLString::equals().

Dave

Reply via email to