problem with getNodeValue

Discussion in 'XML' started by Bernard Kufluk, Apr 21, 2004.

  1. I'm using the IBM4C distribution (Xerces really) and I'm having trouble
    reading a node value.
    I'm reading a large file and most of it works successfully; until I hit a
    section of XML that looks like this:-

    <key mine="1">
    <blah>hello</blah>
    <map>A</map>
    </key>

    <key mine="2">
    <blah>goodbye</blah>
    <map></map>
    </key>

    I can process the first key no problem - when I process the second key - and
    try to get child node on the map - to my surprise it succeds - I would have
    thought that there would be no child of the map element.
    But if there is a child then ok - BUT when I read the text node child of the
    map element - it's value turns out to be "#" !

    What's going on - has anyone else seen this ?

    Thanks

    Bernard
    Bernard Kufluk, Apr 21, 2004
    #1
    1. Advertising

  2. Apologies - I've found my mistake - the code is being clever and picking up
    the default value from the schema as the
    node value is not set.


    "Bernard Kufluk" <> wrote in message
    news:c667at$3q38$...
    > I'm using the IBM4C distribution (Xerces really) and I'm having trouble
    > reading a node value.
    > I'm reading a large file and most of it works successfully; until I hit a
    > section of XML that looks like this:-
    >
    > <key mine="1">
    > <blah>hello</blah>
    > <map>A</map>
    > </key>
    >
    > <key mine="2">
    > <blah>goodbye</blah>
    > <map></map>
    > </key>
    >
    > I can process the first key no problem - when I process the second key -

    and
    > try to get child node on the map - to my surprise it succeds - I would

    have
    > thought that there would be no child of the map element.
    > But if there is a child then ok - BUT when I read the text node child of

    the
    > map element - it's value turns out to be "#" !
    >
    > What's going on - has anyone else seen this ?
    >
    > Thanks
    >
    > Bernard
    >
    >
    >
    >
    Bernard Kufluk, Apr 21, 2004
    #2
    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. Manuel
    Replies:
    0
    Views:
    545
    Manuel
    Aug 28, 2003
  2. Peter Chatterton

    DOM Problem with getNodeValue()

    Peter Chatterton, Oct 19, 2003, in forum: Java
    Replies:
    9
    Views:
    2,796
    Peter Chatterton
    Oct 20, 2003
  3. David
    Replies:
    4
    Views:
    3,802
    Toni Uusitalo
    Dec 17, 2003
  4. Waseem
    Replies:
    0
    Views:
    839
    Waseem
    Jul 6, 2004
  5. Waseem

    getNodeValue Problem -Xerces Perl

    Waseem, Jul 6, 2004, in forum: Perl Misc
    Replies:
    0
    Views:
    136
    Waseem
    Jul 6, 2004
Loading...

Share This Page