MalformedURLException: no protocol
843834Mar 26 2004 — edited Apr 1 2004I've got an XML document that I can parse when I read it from a file. I need to allow a client to submit the XML as an http request parameter. As a testing scenario, I setup a simple .jsp that reads the content of the XML doc, URLEncoder.encode()s it, and writes the contents to a value in an HTML form. When I submit simple form, I read in the parameter and URLDecoder.decode() it. But, when I try to parse the XML I get a java.net.MalformedURLException: no protocol. Based on what I've read, it seems like an odd error for my situation because the XML I'm parsing isn't aware of any other documents. Check it out:
<?xml version=1.0 encoding=utf-8 ?>
<Claim>
<Header Source="ABCCompany" id="123456789" Destination="123Company" MessageType="B1">
<DateTime />
</Header>
<Body>
<Message id="1">Test Data Goes Here</Message>
</Body>
<Trailer id="123456789" Source="ABCCompany" Destination="123Company" MessageType="B1">
<DateTime />
</Trailer>
</Claim>
I'm wondering if I have to write this content to a file and read it back in? That seems like a pretty lame work around, but at least I know I can parse the document if I do that. Any suggestions? .
Thanks,
Derek