I am trying to get ibm aix with universe10 to parse XML documents using this program:
0001: INCLUDE UNIVERSE.INCLUDE XML.H
0002: STATUS = PrepareXML("&XML&/TESTDATA.XML",HANDLE)
0003: IF STATUS NE 0 THEN
0004: STATUS = XMLError(errmsg)
0005: CRT "Prepare ":errmsg
0006: END ELSE
0007: STATUS=OpenXMLData(HANDLE,"&XML&/PingRQ.ext",XMLHANDLE)
0008: IF STATUS NE 0 THEN
0009: STATUS = XMLError(errmsg)
0010: CRT "Open ":errmsg
0011: END ELSE
0012: MOREDATA = 1 ; RECORD = ''
0013: LOOP
0014: STATUS = ReadXMLData(XMLHANDLE,RECORD)
0015: IF STATUS = XML.EOF THEN
0016: MOREDATA = 0
0017: END
0018: WHILE MOREDATA DO
0019: REPEAT
0020: CRT 'read status':STATUS
0021: STATUS = XMLError(errmsg)
0022: CRT "Read ":errmsg
0023: CRT '#':RECORD:'#'
0024: STATUS=CloseXMLData(XMLHANDLE)
0025: CRT "close ": STATUS
0026: STATUS=ReleaseXML(XMLHANDLE)
0027: CRT "release ": STATUS
0028: END
0029: END
0030: RETURN
0031: END
Bottom at line 31.
I get the message "Open U2XMAP: Illegal U2XMAP file, missing the <U2XMAP>." from the
OpenXMLData call.
Any help on the cause of this would be greatly appreciated
The xml document looks like this:
<OTA_PingRQ xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http
://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ope
ntravel.org/OTA/2003/05 OTA_PingRQ.xsd" TimeStamp="2003-03-17T11:09:47-05
:00" Target="Production" Version="1.001" SequenceNmbr="1"> <EchoData>Ar
e you there</EchoData> </OTA_PingRQ>
The .ext is in &XML& and looks like this
0001: <?xml version="1.0"?>
0002: <U2xml-extraction xmlns:U2xml="xsi:schemaLocation="http://www.ope
ntravel.org/OTA/2003/05 OTA_PingRQ.xsd">
0003: <U2xml:extraction start="/OTA_PingRQ" dictionary="OTA_PingRQ" null="NULL"/>
0004: <U2xml:field_extraction field="XMLNS" path="/OTA_PingRQ/xmlns/text()"/>
0005: <U2xml:field_extraction field="XSI" path="/OTA_PingRQ/xmlns:xsi/text()"/>
0006: <U2xml:field_extraction field="SCHEMALOCATION"
path="/OTA_PingRQ/xsi:schemaLocation/text()"/>
0007: <U2xml:field_extraction field="TIMESTAMP" path="/OTA_PingRQ/TimeStamp/text()"/>
0008: <U2xml:field_extraction field="TARGET" path="/OTA_PingRQ/Target/text()"/>
0009: <U2xml:field_extraction field="VERSION" path="/OTA_PingRQ/Version/text()"/>
0010: <U2xml:field_extraction field="SEQUENCENMBR"
path="/OTA_PingRQ/SequenceNmbr/text()"/>
0011: <U2xml:field_extraction field="ECHODATA" path="/OTA_PingRQ/EchoData/text()"/>
0012: </U2xml-extraction>
Bottom at line 12.
I have created a .map file also in &XML& which look like this: (though I am not sure I
need it)
0001: <?xml version="1.0"?>
0002: <U2XMAP Version="1.0" Name="OTA_PingRQ">
0003: <TABLECLASSMAP MapName="OTA_PingRQ" StartNode = "/OTA_PingRQ" TableName="
OTA_PingRQ">
0004: <ColumnMap Node="@xmlns" Column="XMLNS"/>
0005: <ColumnMap Node="@xsi" Column="XSI"/>
0006: <ColumnMap Node="@schemalocation" Column="SCHEMALOCATION"/>
0007: <ColumnMap Node="@timestamp" Column="TIMESTAMP"/>
0008: <ColumnMap Node="@Target" Column="TARGET"/>
0009: <ColumnMap Node="@Version" Column="VERSION"/>
0010: <ColumnMap Node="@SequenceNmb" Column="SEQUENCENMBR"/>
0011: <ColumnMap Node="@SequenceNmb" Column="@ID"/>
0012: <ColumnMap Node="@EchoData" Column="ECHODATA"/>
0013: </TABLECLASSMAP>
0014: </U2XMAP>
The target file has this dictionary
DICT OTA_PingRQ 15:54:47 10-06-04 Page 1
Type &
Field......... Field. Field........ Conversion.. Column......... Output Depth &
Name.......... Number Definition... Code........ Heading........ Format Assoc..
@ID D 0 OTA_PingRQ 10L S
XMLNS D 1 xmlns 40L S
XSI D 2 xsi 40L S
SCHEMALOCATION D 3 schemalocation 40L S
TIMESTAMP D 4 Timestamp 25L S
TARGET D 5 Target 10L S
VERSION D 6 Version 5L S
SEQUENCENMBR D 7 Seqn 1R S
ECHODATA D 8 Data 60T S
9 records listed.
Thanks in advance
Bob
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/