UNIVERSE XML: XDOMGetNodeValue



Hello,

I am trying to read a simple XML file and get the node values using
basic a
routine (uv 10.1)

XML file looks like,
<NAME>
<FIRSTNAME>JOHN</FIRSTNAME>
<LASTNAME>SMITH</LASTNAME>
</NAME>

The basic routine is:

STATUS = XDOMOpen(XMLFILENAME,XML.FROM.FILE,mydom)
STATUS = XDOMLocate(mydom,"NAME","",N1HANDLE)
STATUS = XDOMLocateNode(N1HANDLE, XDOM.CHILD,
XDOM.FIRST.CHILD,XDOM.ELEMENT.NODE, N2HANDLE)
STATUS = XDOMGetNodeName(N2HANDLE, MYNODENAME)
CRT "STATUS = ":STATUS:", NODE NAME ":MYNODENAME:
STATUS = XDOMGetNodeValue(N2HANDLE, MYNODEVALUE)
CRT "STATUS = ":STATUS:", NODE VALUE ":MYNODEVALUE

When I run the program, first CRT command shows "STATUS = 0 and
NODENAME = FIRSTNAME.

Second CRT shows, STATUS = -1 , NODEVALUE =

Why I am not getting any values here? What I am doing wrong?

When I do some error checking,
ERR.STATUS = XMLGetError(STATUS,MSG)
MSG = "No reqested data was available."
.



Relevant Pages

  • XML parser
    ... For one of my applications I write and read some data to / from a CSV file ... Now I want to replace the CSV file by a XML file. ... because it wouldn't be too hard to code my own routine to ...
    (borland.public.delphi.thirdpartytools.general)
  • Comparing to (XML) files?
    ... I have a routine that downloads an XML file from an external source ...
    (microsoft.public.vsnet.general)
  • Creating Access MDBs with ADOX.
    ... I have been working on a routine to move data from an XML file to an Access ... MDB. ... Prev by Date: ...
    (microsoft.public.data.ado)
  • Re: compare 2 text files - check for difference - Please help
    ... I have a huge xml file that I am reading in after a submit routine. ... routine fails on specific xml elements. ...
    (comp.lang.ruby)
  • Re: XML parser
    ... > Probably a parser for reading would do, ... > wouldn't be too hard to code my own routine to write the XML file. ... Since I am the author, you can get support from me, even if I ...
    (borland.public.delphi.thirdpartytools.general)

Loading