Importing xml

bohrmann

Member
Hi,

Is there any way to import an xml file to Progress? As per my best knowledge it's not possible in our system. So far I've used csv files only, but now I should import an xml, looking like this:

<?xml version="1.0" encoding="UTF-8"?>
<OPPORTUNITY_LIST>
<xsdLocal1:OPPORTUNITY>
<xsdLocal1:CLOSEDATE>08/11/2010 00:00:00</xsdLocal1:CLOSEDATE>
<xsdLocal1:NEGOCIATED_PRICE>22</xsdLocal1:NEGOCIATED_PRICE>
<xsdLocal1:STMNMONIQUE_ISP>AASCCAERAH</xsdLocal1:STMNMONIQUE_ISP>
<xsdLocal1:pRODUCTINTEREST>FODFR</xsdLocal1:pRODUCTINTEREST>
<xsdLocal1:CUST_MNMC>AASCPAR75C</xsdLocal1:CUST_MNMC>
</xsdLocal1:OPPORTUNITY>

Our Progress version is 9.1E, OS is Sun Solaris.
 

TomBascom

Curmudgeon
9.1E does support a DOM XML parser. Details are in the "External Interfaces" manual. You can also get some coding samples from the knowledgebase by entering "XML DOM examples"

Personally I prefer SAX but that requires 10.x.
 

bohrmann

Member
Just found a sample code, which works fine, but I have an error message related to prefixes:

X-NODEREF or X-DOCUMENT LOAD got an error: FATAL ERROR: file '<filename>.xml', line '1', column '83', message 'The prefix 'xsdLocal1' has not been mapped to any URI'.

The input file looks like:

<?xml version="1.0" encoding="UTF-8"?>
<OPPORTUNITY_LIST>
<xsdLocal1:OPPORTUNITY>
<xsdLocal1:CLOSEDATE>08/11/2010 00:00:00</xsdLocal1:CLOSEDATE>
<xsdLocal1:NEGOCIATED_PRICE>22</xsdLocal1:NEGOCIATED_PRICE>
<xsdLocal1:STMNMONIQUE_ISP>AASCCAERAH</xsdLocal1:STMNMONIQUE_ISP>
<xsdLocal1:pRODUCTINTEREST>FODFR</xsdLocal1:pRODUCTINTEREST>
<xsdLocal1:CUST_MNMC>AASCPAR75C</xsdLocal1:CUST_MNMC>
</xsdLocal1:OPPORTUNITY>

It worked only if I removed the 'xsdLocal1:' prefixes.
Can these prefixes be handled by Progress somehow?
 

RealHeavyDude

Well-Known Member
The XML is not well-formed. That has nothing to do with Progress - which, AFAIK, uses the Xerces XML parser. You can't have the URI on the end tag but not on the start tag of the OPPORTUNITY_LIST element ...

Heavy Regards, RealHeavyDude.
 
Top