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
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 23. juli 2001 19:34
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: Query regarding xerces for post method
I am sorry I am not able to explain it properly. let me try.
The thing I sent the code of the parser I am using. It
basically parses a xml file.the xml file is returned from a
site. The xml file can be fetched using get and post method.
I have to check whether the xml file is well formed or not.
By well formed I mean the braces of the xml file like
<abc> xcvcxv </abc
is not well formed.
If xml file containing this type of error is fetched then
parser should give error of being not well formed. This thing
works good with get method and not with post method. With get
method it validates and give an error of not well formed. In
post it doesn't check the braces.
I hope you would now understand my problem.
vijay
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]