yogeshwar_ade
Active User
Joined: 31 Aug 2006 Posts: 103 Location: INDIA
|
|
|
|
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. |
|
ashutosh.pr
New User
Joined: 13 Apr 2007 Posts: 36 Location: Pune
|
|
|
|
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 |
|