Hi
Thanks Gulli. I haven't got answer. I would explain it more. 
I have done the same way as you told (InputSource with a URL 
(systemId)). For test purposes I am passing same ill formed 
xml from server to the application for both methods. With Get 
it says that it is ill formed. With Post it doesn't give 
anything about ill formed. I think error is when I parse

in case of get 
xmlFile = www.abc.com?abc = "user"

in case of post
xmlFile = www.abc.com

parameter is posted using

URLConnection.setDoInput(true);
DataOutputStream out = new DataOutputStream
(URLConnection.getOutputStream());
out.writeBytes("abc=user");

domParser.parse(new InputSource(xmlFile));

in this case 
how does this parse function works.

in case of get it get the url and parameters with "?"

in case of post it get the url only.

Thanks
vijay



Hi Vijay,

That's clearer ... but for what it's worth, I
suggest that you make an effort to reorganize
your code before you try to figure out what's
going wrong in it. Here's a hint: When you give
your parser an InputSource with a URL (systemId),
it will simply open a connection to that URL
(which I presume is an HTTP URL, so by default
that would be a GET query) and read from it
directly. So all the URLConnection stuff you
do in there has nothing to do with the parse.
And even if you get an ill-formed document out
of the POST query you perform, that doesn't mean
the parser is also getting an ill-formed document
from its GET query. The server may send different
results for the two different types of queries.

But in any case, determining well-formedness
requires no coding by you -- you just execute
DOMParser.parse(InputSource) without setting an
ErrorHandler, and it will throw an Exception
if there's anything wrong. If you get past
that call and obtain the Document, then your
XML is well formed, as simple as that.

Take a look at the samples in
http://xml.apache.org/xerces-j/samples.html
for inspiration ...

Cheers,

        - Gulli

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to