[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Intermittent problem parsing an XML document with Expat



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>

1.  We now have several jobs receiving XML data from our vendors.  However,
every now and then, there is a parsing error from Expat.

What's the error?



2. My program reads an XML document in the IFS, to parse it to a work file. But sometimes, it splits the XML data into two occurrences of the tag, and writes two records to the work file. I can never find anything wrong with the input document.

Linda... there's no law that says that all character data must be received in one call to the character data handler. I think the problem is that you're expecting to receive everything at once. So as soon as your character data handler is called, you go ahead and list the output.


Instead, you should store the XML data until you receive an ending element. Only when the end handler is called for your element should you attempt to use the character data.

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------