IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

XML parse query


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
yogeshwar_ade

Active User


Joined: 31 Aug 2006
Posts: 103
Location: INDIA

PostPosted: Tue Oct 06, 2009 3:46 pm
Reply with quote

Hi Team,

I had small query regarding XML parse Command.

When I am running XML parse command , the event handler sometimes recognising space between start and end tag as Contain Characters and sometimes not.

Like below tag – Ideally the parse command should enter in Contain Characters condition but it’s not behaving like that.

<A> </A>

Could you please someone help me.
Back to top
View user's profile Send private message
ashutosh.pr

New User


Joined: 13 Apr 2007
Posts: 36
Location: Pune

PostPosted: Tue Oct 06, 2009 9:56 pm
Reply with quote

Hi Yogeshwar,
Is your program failing when reading spaces? I suggest you change your approach to read the data. If spaces are being read where you are expecting the event handler to return some data being read, then move one more event forward and you should get the data.
eg. <A>Data </A> , if you encounter spaces after the data, move one more event forward to get the end of the tag.
Similarly, if you get <A> Data</A> , i.e data followed by spaces, make one more read and get the data.

Do not expect the parser to return the data you want after some no of reads. Instead keep reading, till you get to the data. Start of tags and end of tags will help you recognize that you have read the correct data.

I had written a program to read XML a few years back, and the one thing I remember about it was that it was very specific to the XML structure that it was reading.
The key thing is to know the sequence in which the different components will be read and then manipulate the logic accordingly.

Thanks,
Ashutosh
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
Search our Forums:

Back to Top