3 Jan 2007 07:09
RE: [U2][UV] XML Extraction
Jeff Marcos <jeff.marcos <at> ce.com.au>
2007-01-03 06:09:19 GMT
2007-01-03 06:09:19 GMT
Try using the
1. PrepareXML("&XML&/":XML.KEY,XML_HANDLE)
2. OpenXMLData(XML_HANDLE,XML.EXT,XML_DATA_HANDLE)
3. ReadXMLData(XML_DATA_HANDLE,rec)
4. CloseXMLData(XML_DATA_HANDLE)
5. ReleaseXML(XML_HANDLE)
XML.EXT = the extraction map
Rec = the extracted data
Regards,
Jeff Marcos
-----Original Message-----
From: owner-u2-users <at> listserver.u2ug.org
[mailto:owner-u2-users <at> listserver.u2ug.org] On Behalf Of Mitchell,
Stewart
Sent: Wednesday, 3 January 2007 2:32 PM
To: 'u2-users <at> listserver.u2ug.org'
Subject: [U2][UV] XML Extraction
Hi All,
Does anyone how to extract data from an xml file using attributes.
This works for elements but I don't know the syntax for attributes and I
found the manual unclear.
//// Element based xml
ORDER.EXT (file)
<?xml version = "1.0"?>
<U2xml-extraction xmlns:U2xml="http://www.ibm.com/U2-xml">
<U2xml:file_extraction start="/ROOT" dictionary = "" null = "EMPTY" />
<U2xml:field_extraction field="Customer" path="ORDERS/CUSTOMER/text()"
/>
</U2xml-extraction>
ORDER.XML (file)
<?xml version="1.0"?>
<!DOCTYPE ROOT[
<!ELEMENT ROOT ( ORDERS* )>
<!ELEMENT ORDERS(Customer+)
<!ELEMENT Customer (#PCDATA) >
]>
<ROOT>
<ORDERS>
<CUSTOMER>9688455</CUSTOMER>
</ROOT>
//// End of element based xml
If the ORDER.XML file is constructed as shown below what is the syntax
for
the extraction file ORDER.EXT
//// Attributed based xml
<?xml version="1.0"?>
<!DOCTYPE ROOT[
<!ELEMENT ROOT ( ORDERS* )>
<!ELEMENT ORDERS EMPTY>
<!ATTLIST ORDERS CUSTOMER CDATA #REQUIRED>
]>
<ROOT>
<ORDERS CUSTOMER = "9688455"/>
</ROOT>
TIA
Stewart
**********************************************************************
This email and any attachments are confidential. They may contain
legally privileged information or copyright material. You should not
read, copy, use or disclose them without authorisation. If you are not
an intended recipient, please contact us at once by return email and
then delete the original message and all copies. We do not accept
liability in connection with computer virus, data corruption, delay,
interruption, unauthorised access or unauthorised amendment.
**********************************************************************
-------
u2-users mailing list
u2-users <at> listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users <at> listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
RSS Feed