MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

COBOL XML PARSER question

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
chrisw
Beginner


Joined: 09 Apr 2008
Posts: 1
Topics: 1

PostPosted: Thu Jul 10, 2008 1:54 pm    Post subject: COBOL XML PARSER question Reply with quote

Hi,

I'm using the COBOL XML PARSER (XML-PARSE stmt) for the first time and attempting to parse a document that has the same element tag <RqUID> in multiple places throughout the XML doc. For example...

<BankSvcRq>
<RqUID>123-456-789</RqUID>
<AcctInqRq>
<RqUID>454-123-987</RqUID>
</AcctInqRq>
</BankSvcRq>

Is there some mechanism/feature of the XML PARSER that will allow me to differentiate between the two occurences of RqUID or will I have to manage this situation using COBOL logic?

Any help would be appreciated!
Thanks, Chris.
Back to top
View user's profile Send private message
ash_sudp
Beginner


Joined: 17 May 2006
Posts: 12
Topics: 0

PostPosted: Tue Jun 09, 2009 3:30 pm    Post subject: Reply with quote

Cobol entreprise parser does not have the functionality. But you can build a wrapper arount the built in parser to identify any tag that occurs multiple times.
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Tue Jun 09, 2009 10:21 pm    Post subject: Reply with quote

When you define the copy book to populate those fields, just make them unique, like: BSR-RqUID and AIR-RqUID for instance. When I encountered this situation, I prefixed the RqUID with the level number of the field, like 15-RqUID and 20-RqUID. Whatever you need to do to make them unique.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group