Hi friends again me.
I have this XML file:
<data>
<form id="2" name="Estudio Socioeconomico" submitTo="eguarda-estudio">
<field1 name="last_name" Label="Last Name" type="text" Value="Smith"/>
<field name=First_name" Label="Name" type="text" Value="Henry"/>
[...]
</form>
</data>
I load my file with this command:
hDoc:LOAD("file", "(location_file.XML)", FALSE).
hDoc:GET-DOCUMENT-ELEMENT(hRoot).
REPEAT ix = 1 TO hRoot:NUM-CHILDREN:
hRoot:GET-CHILD(hTable, ix).
REPEAT jx = 1 TO hTable:NUM-CHILDREN:
hTable:GET-CHILD(hField, jx).
hDBFld = hBuf:BUFFER-FIELD(hField:NAME).
hField:GET-CHILD(hText, 1).
hDBFld:BUFFER-VALUE = hTEXT:NODE-VALUE.
END.
END.
But I cant save the VALUE data of the xml into a temp-table.
Can u help me please.
Thanks regards.
I observe that you are trying to read XML file and put that data into a temp-table. READ-XML() can be handy for this scenario.
You cannot use READ-XML to load the above document into a temp-table. READ-XML requires a specific format. There is an example of reading an XML Document and creating temp-table record in the 'Working with XML' book of our documentation set. Look at Chapter 2: Reading and Writing XML with the Document Object Model (DOM)
It looks like you are mainly missing the creation of the temp-table record
Hi friends.
I used the SAX control to read XML file and create the temp table with the values...
this example helped me with my trouble.