problem with getNodeValue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bernard Kufluk

    #1

    problem with getNodeValue

    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@uk.ibm. com



  • Bernard Kufluk

    #2
    Re: problem with getNodeValue

    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" <bernard@uk.ibm .com> wrote in message
    news:c667at$3q3 8$1@sp15en20.hu rsley.ibm.com.. .[color=blue]
    > 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 -[/color]
    and[color=blue]
    > try to get child node on the map - to my surprise it succeds - I would[/color]
    have[color=blue]
    > 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[/color]
    the[color=blue]
    > map element - it's value turns out to be "#" !
    >
    > What's going on - has anyone else seen this ?
    >
    > Thanks
    >
    > Bernard
    > bernard@uk.ibm. com
    >
    >
    >[/color]


    Comment

    Working...