i use follows code to get a XML Document (by JDOM in java):
SAXBuilder builder = new SAXBuilder();
Document doc= builder.build(new URL("http://www.sasatuan.com/api/api.php"));
and i get a Exception:
org.jdom.input.JDOMParseException: Error in building:
http://www.sasatuan.com/api/api.php:1: <?xml ... ?> occurs after content. The
<?xml ... ?> prolog must be at the document start.: http://www.sasatuan.com/api/
api.php:1: <?xml ... ?> occurs after content. The <?xml ... ?> prolog must be a
t the document start.
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:473)
...
i type this URL http://www.sasatuan.com/api/api.php
in IE,it's be ok,but in firefox or chrome,it's same error.
this xml header not at the document start,so jdom can't read it.
i think trim() the xml content before build can revise this problem, i want know how to do this.
thanks for help :)