[jdom-interest] Parsing XML with end of stream marker

Jon Baer jonbaer at digitalanywhere.com
Mon Jun 25 05:20:56 PDT 2001

Yeah ur gonna have to trim that bad boy off, Id say extend the Reader and create your
own and either test for </soap-env:envelope> or substring it till indexOf("<EOS>");
or something.

The builder lets you take a String now so you might wanna filter the stream first
before you pass it to the builder.

- Jon

Tim Sawyer wrote:

> Hi,
> For various really annoying reasons, I have some XML that I am getting with
> an <EOS> tagged onto the end of it.  So my message that I am trying to parse
> contains something like:
> <?xml version='1.0' encoding='ISO-8859-1'?>
> <soap-env:envelope
> xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope">
> <soap-env:body>
> <m:loginapplicationresponse xmlns:m="http://www.pancredit.com/methods"
> xmlns="http://www.pancredit.com/schemas">
> <securitytoken>69706GD5S3Q34</securitytoken>
> <username>tim</username>
> </m:loginapplicationresponse>
> </soap-env:body>
> </soap-env:envelope><EOS>
> If I parse this using:
> SAXBuilder lBuilder = new SAXBuilder();
> Document lResultsDocument = lBuilder.build(this.resultsStream);
> then I get the error
> org.jdom.JDOMException: Error on line 10: The markup in the document
> following the root element must be well-formed.
>         at org.jdom.input.SAXBuilder.build(SAXBuilder.java, Compiled Code)
> Does anyone know a reasonably elegant way to deal with this?
> Cheers,
> Tim.
> This e-mail and its attachments are for the use of the addressee only.
> It may contain information that is legally privileged, confidential and
> exempt from  disclosure.  It is not a contract, and prices, data
> and other information are not warranted as to completeness or accuracy.
> Any comments or statements  made herein do not necessarily
> reflect those of PanCredit Systems Limited. If you are not the intended
> recipient you must not copy, distribute or disseminate this e-mail
> or attachments to anyone other than the addressee.
> If you receive this communication in error please advise us by telephone
> at once.
> PanCredit Systems Limited
> Tel:    +44 113 250 0260
> Fax:    +44 113 250 0621
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com

More information about the jdom-interest mailing list