By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,245 Members | 1,103 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,245 IT Pros & Developers. It's quick & easy.

XMLCh and getNodeName

P: n/a
Hello,

{ ahem! I am writing a DOM based application on Linux, using C++ (gcc
3.x.y.z) and the Xerces-C XML parser ...}

Sometimes I see code that calls an equals("some string") method on the type
returned by getNodeName or getNodeValue. Somehow this does not seem to be
correct.

Since I am trying to learn more about XMLCh and DOMNode specifically from
what I can see in the code, XMLCh is a typedef to either wchar_t or unsigned
short, depending on platform.

My question revolves around the getNodeName method, which returns an XMLCh *

const XMLCh * getNodeName () const=0
The name of this node, depending on its type; see the table above. More...

const XMLCh * getNodeValue () const=0
Gets the value of this node, depending on its type.

My question is that I sometimes see code that says

somenode.getNodeName().equals("Foo Text");

This looks all nice and dandy, but getNodeName returns an XMLCh (which
obviously has no member functions, since it is typdefed short or wchar_t).

Did getNodeName used to return a DOMString in an earlier version? And is the
above code still legal in the current DOM Implementation?

Thanks for taking time to read this.

AOyake
Jul 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.