aspose file tools*
The moose likes Web Services and the fly likes java.net.MalformedURLException: no protocol: <projects timestamp=<..." title="" /> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "java.net.MalformedURLException: no protocol: <projects timestamp="2009/10/12 14:32:15" xmlns=""><..." Watch "java.net.MalformedURLException: no protocol: <projects timestamp="2009/10/12 14:32:15" xmlns=""><..." New topic
Author

java.net.MalformedURLException: no protocol: <projects timestamp="2009/10/12 14:32:15" xmlns=""><...

bubu lina
Greenhorn

Joined: Aug 11, 2008
Posts: 28
Hello
I wanna parse an xml. should be an easy thing to do i think. Using dom4j.
i have the xml, it starts with:


For me it looks like a normal xml.
when i try to parse it:


i get this great exception:
java.net.MalformedURLException: no protocol:
...
at java.net.URL.<init>(URL.java:567)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at ro.web.UnitTest.parseXML(UnitTest.java:94)
at ro.web.UnitTest.main(UnitTest.java:71)

Did put it in a try catch thing..no use.

Does anyone know any soluttion to this. i am sure it's gonna be easier that i can grasp...
Thank you
bubu lina
Greenhorn

Joined: Aug 11, 2008
Posts: 28
solution found from java sun forum: reader.getXMLReader().parse(new InputSource(new StringReader(XMLMessage)));
 
jQuery in Action, 2nd edition
 
subject: java.net.MalformedURLException: no protocol: <projects timestamp="2009/10/12 14:32:15" xmlns=""><...