xml-into problem

15 pts.
Tags:
xml-into ccsid xml iseries rpg
I want to process an xml file from the IFS in an RPG program, but always get "The XML parser detected error code 302." Nothing I do seems to fix the problem. I checked the XML-file with WRKLNK, it is ccsid 1208 (utf-8) and the first character is 3C (<). Job ccsid is 65535. Iseries release V5R4.
Any help would be much appreciated!

File and program code as follows: 

XML-file:
        
                                                
    createInvoice        
    1                
    3                            
    1                              
                                               

RPG-program:
H Debug                                                 
H Datfmt(*ISO)                                          
H Datedit(*YMD)                                         
H Option(*srcstmt)                                      
H Indent('|')                                           
H DftActGrp(*NO)                                        
                                                        
d xmlfile         s           6000a   varying           
d xmlopt          s            100a   varying           
d divider         s             52a                            
                                                               
d BusinessEvent   ds                  qualified                
d                                     based(Template)          
d  BusinessEventType...                                        
d                               30a                            
d  BusinessEventTypeId...                                      
d                                1s 0                          
d  SendingSystem...                                            
d                                1s 0                          
d  SalesChannel...                                             
d                                1s 0                          
                                                               
 /free                                                         
  xmlfile  = '/TEST/FILE.xml';      
  xmlopt =  'doc=string case=any allowextra=yes allowmissing=yes';                                        
  xml-into BusinessEvent %xml(%trim(xmlfile): xmlopt);               
  *inlr = *on;                                                       
/End-free                                                                                                          


Software/Hardware used:
V5R4
ASKED: September 24, 2013  2:53 PM
UPDATED: September 28, 2013  8:14 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • BestUM
    Error in copy/pasting the xml file content. The following is correct.
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>          
    <BusinessEvent>                                                  
        <BusinessEventType>createInvoice</BusinessEventType>         
        <BusinessEventTypeId>1</BusinessEventTypeId>                 
        <SendingSystem>3</SendingSystem>                             
        <SalesChannel>1</SalesChannel>                               
    </BusinessEvent>                                                 
    15 pointsBadges:
    report
  • TomLiotta

    From the V5R4 ILE RPG Programmer's Guide:

    • The parser does not support every CCSID. If your job CCSID is one |of the CCSIDs that the parser does not handle, you must parse your document in |UCS-2. |
    • |The following EBCDIC CCSIDs are supported: 1047, 37, 1140, 273, |1141, 277, 1142, 278, 1143, 280, 1144, 284, 1145, 285, 1146, 297, 1147, 500, |1148, 871, and 1149.
    • |The following ASCII CCSIDs are supported: 819, 813, 920.
    • |The following Unicode CCSIDs are supported: 1200, 13488, |17584.

    UTF8 (CCSID 1208) is not listed as supported by the ILE RPG language built-in XML-INTO operation code. When an unsupported CCSID is encountered, error code 302 is thrown.

    Also, a job CCSID of 65535 is just asking for trouble. Use the appropriate CCSID if you're going to be doing any kind of character conversions at all. CCSID 65535 is 'binary; no character conversion'.

    Tom

    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following