XMLCh and getNodeName

Discussion in 'XML' started by AOyake77, Jan 7, 2005.

  1. AOyake77

    AOyake77 Guest

    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
     
    AOyake77, Jan 7, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. C_Vieri
    Replies:
    0
    Views:
    832
    C_Vieri
    Jan 7, 2005
  2. Replies:
    0
    Views:
    4,543
  3. =?ISO-8859-15?Q?R=E9mi_Peyronnet?=

    STL & basic_string<XMLCh> link error

    =?ISO-8859-15?Q?R=E9mi_Peyronnet?=, Feb 16, 2004, in forum: C++
    Replies:
    0
    Views:
    535
    =?ISO-8859-15?Q?R=E9mi_Peyronnet?=
    Feb 16, 2004
  4. wolverine

    XMLCh and wchar_t

    wolverine, Nov 1, 2006, in forum: C++
    Replies:
    3
    Views:
    965
    P.J. Plauger
    Nov 1, 2006
  5. Meal
    Replies:
    3
    Views:
    1,185
    Joe Kesselman
    Jul 20, 2007
Loading...

Share This Page