> Never done this....fairly new as well.
>
[quoted text clipped - 10 lines]
>
> TRW

Signature
Steve W. Jackson
Montgomery, Alabama
Thanks Steve.
Yes, I agree with that.
Is there a way to parse the document without having a definition
document
or schema?
Basically, just check pure syntax not to see if the tags are valid.
Steve W. Jackson - 12 Jan 2006 20:32 GMT
> Thanks Steve.
>
[quoted text clipped - 4 lines]
>
> Basically, just check pure syntax not to see if the tags are valid.
Assuming you want to use the XML facilities built into Java, it's as
easy as pie. You'll need to call DocumentBuilderFactory.newInstance()
to get a new DocumentBuilderFactory, then configure factory (see the API
in javax.xml.parsers). Call the factory's newDocumentBuilder() method
to create a DocumentBuilder, and the call the builder's parse() method.
There are multiple parse methods, allowing you to parse a file,
InputStream or InputSource. One of those also makes it possible to
parse a string rather than reading a file. And no validation against
any DTD or schema will be attempted when the factory is configured that
way.
= Steve =

Signature
Steve W. Jackson
Montgomery, Alabama
James Westby - 12 Jan 2006 22:03 GMT
> Thanks Steve.
>
[quoted text clipped - 5 lines]
>
> Basically, just check pure syntax not to see if the tags are valid.
How about
http://www.perfectxml.com/JAXP.asp
Or there are many XML tutorial available on the web, you just need to
find one that shows how to using your chosen technologies.
The tutorial above uses DOM and JAXP, but there are other parsers
available. You could also use SAX if you are worried about memory. There
is the option to implement something yourself if you are really
concerned with speed and simplicity and just want to check e.g. that
every opening tag has a closing tag, this would be pretty easy. However
if you decided you wanted to do a little more later on it would be
benificial to be using something with more functionality.
James