Options

XML problem

frankdynamicfrankdynamic Member Posts: 11
Hello,

I want to import a XML file with a new XML-port. More then one of the element names has in the name the prefix : (example : <nl:Staffing>).


When I start the import with this code:

TESTFILE.OPEN('c:\TEST.XML');
TESTFILE.CREATEINSTREAM(TESTSTREAM);
XMLPORT.IMPORT(50002,TESTSTREAM);
TESTFILE.CLOSE

i got the error "The XML-parser returns the folowing fatal error:
Undeclared prefix.
Line number = 15 Cloumn number = 37.

if I delete the prefix : in the element names, the import is succesfull.

Does anyone know how to solve the problem with the prefix : in the element names

Thanks

Answers

  • Options
    dbezzantdbezzant Member Posts: 10
    Did anyone solve this? I am running into a bunch of stupid errors with this XMLport object this being one of them.

    Is the XMLPort even vaiable as an option or should I just breakdown and learn how to use the DOM?
  • Options
    TFCrowtherTFCrowther Member Posts: 35
    I'm having the same problem with an XML file containing a load of : (colons)

    <?xml version="1.0" encoding="utf-8"?>
    <ENV:Envelopes>
    <ENV:SenderID>PMK</ENV:SenderID>
    <ENV:RecipientID>LXD</ENV:RecipientID>
    <ENV:DocumentCount>1</ENV:DocumentCount>
    </ENV:Envelopes>

    The solution I've used is to remove the : before the import the XML using some File commands.
    There is a good example here by jreynolds.

    http://www.mibuso.com/forum/viewtopic.php?f=23&t=29313&p=146950#p146950

    Works a treat.
Sign In or Register to comment.