Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple XML docs in single servlet response

Status
Not open for further replies.

tiliqua

Technical User
Nov 3, 2003
1
AU
Hi, forgive the complete newbie Q.

I am forced to use a buggy proprietry java servlet in an app I manage. It takes various requests, does some processing and responds in XML. Some requests generate multiple XML docs in the same response, such the following when the java code throws an exception:
Code:
<?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?>
<SomeResponse>
   <SomeValue/>
</SomeResponse>
<?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?>
<SomeException>
    Exception text...
</SomeException>
This servlet is being connected to by clients outside my control and generates XML parsing errors in the browsers, java clents etc... eg. &quot;XML Parsing Error: junk after document element&quot; or &quot;Only one top level element is allowed in an XML document&quot;. Nor do I have any control over what the servlet spits out. My workaround so far has been to disable the requests that generate the badly formed xml.

My question is... Is there a way to deal with this using XSL?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top