Hi.
I'm using XML to represent some bits of data that I'm passing between
a server and a client. They're actually bits of abstract syntax tree
representing some expressions, but that's not really important here. I
have a DTD which describes what the format of the expressions should
be.
So my XML data looks something like:
<?xml version="1.0"?>
<!DOCTYPE EXPR SYSTEM "expr.DTD">
<EXPR>
...
</EXPR>
I have a couple of questions.
1) I'd like to validate the XML. How do I get the parser to look the
DTD up in some external catalogue? Say I know that the DTD is
available from:
http://somehost/expr.dtd
I guess I use an EntityResolver, but I'm not quite sure how I go about
that.
2) I don't want to go away and have to look the DTD up *every* time I
get one of these things to parse, so is there a way I can pull the DTD
in once and then pass the parser some kind of in-memory object
representing the DTD?
I'm using Sun's Project X Technology Release 1 along with JDK
1.2. Thanks in advance for any assistance.
Cheers,
Sean B
==========================================================================
| Sean Bechhofer | |
| Research Fellow | |
| Information Management Group | |
| Computer Science Department | |
| Oxford Road | Tel: +44-161-275-6145 |
| Manchester M13 9PL | Fax: +44-161-275-6932 |
|------------------------------------------------------------------------|
| WWW: http://potato.cs.man.ac.uk/seanb |
==========================================================================