Using XML-into in RPG getting error

15 pts.
Hello.. I am having an issue using xml-into when my xml has only an ending tag. I am receiving error "XML document does not match RPG variable". The vendor sending the xml file to me states it is still valid xml and should not cause error. How can I get around this error using xml-into. My xml looks like this..
<?xml version="1.0"?>
  <createdOn>2018-10-01 15:45:27 UTC</createdOn>
      <complaint>CAME IN FOR RECALL AA8Z0</complaint>
      <cause>PERFORMED RECALL</cause>
      <correction>COMPLETED RECALL</correction>
and my xml-into looks like this -
XML-INTO estimate %XML(%trim(Pathp1) : 'doc=file path=estimate + case=any allowextra=yes allowmissing=yes + ns=remove countprefix=cnt');
I believe I get the error because <laborTime/> and <parts/> are only ending tags with no beginning tags. I used the allowmissing=yes thinking that would help but still getting error.
Thank you

Answer Wiki

Thanks. We'll let you know when a new response is added.

Check out this older post from this site on the issue HERE it’s from 2010 but addresses the issue.

Discuss This Question: 3  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.
  • TheRealRaven
    You didn't include the message ID, so it's not certain. It appears to be RNQ0353. What did you find when took the 'Recovery' steps given in the message?
    36,420 pointsBadges:
  • clauinger
    Yes the message id is RNQ0353. The recovery steps said you needed to either fix the xml or add allowmissing=Yes to the xml-into statement. I already had the allowmissing=Yes in the xml-statement and the xml is ok. When I searched internet to see if it was valid to have only ending tags, it said yes it was. For instance the   <laborTime/> only was valid xml. So I am not sure why it thinks the xml is not matching RPG variable. Also my data structure is defined as

    estimate        DS                  Qualified            
    d  stage                        20                         
    d  dealerId                     10                         
    d  estimateId                   10                         
    d  vin                          20                         
    d  mileage                       7  0                      
    d  roNumber                     10                         
    d  createdOn                    20                         
    d  items                              LikeDS(items)        
    d  items          DS                  Qualified            
    d   item                              LikeDS(item)         
    d                                     Dim(20)              
    d  item           DS                  Qualified            
    d   lineNumber                  10                         
    d   opcode                      10                         
    d   laborTime                    7  1                      
    d   complaint                  432                         
    d   cause                      432                         
    d   correction                 432                       
    d   warranty                     1                       
    d   policy                       1                       
    d   variation                   10                       
    d   parts                             LikeDS(parts)      
    d  parts          DS                  Qualified          
    d   part                              LikeDS(part)       
    d                                     Dim(99)            
    d  part           DS                  Qualified          
    d   partNumber                  20                       
    d   quantity                     7  1                    
    d   unitPrice                   11  1                    

    15 pointsBadges:
  • GregManzo
    Technically <laborTime/> is not an ending tag, it's a closed tag. It's the same as having begin & end with nothing between, ie: <laborTime></laborTime> and yes, it is valid XML. But that doesn't explain your error.
    I've always preferred XML-SAX over XML-INTO because it gives me more control, so I'm not 100% sure but willing to have a guess.
    I notice you have some data elements that are too big for your variables, eg: createdOn & opcode. Can you try making them bigger & see if it helps?
    2,970 pointsBadges:

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.

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


Share this item with your network: