Re: RFC: Simple XML Event-Based API for Java

David Megginson (ak117@freenet.carleton.ca)
Wed, 17 Dec 1997 14:03:43 -0500


Tim Bray writes:

> I'd be willing to commit to signing up to do this for Lark, given
> the following changes:
>=20
> > public void=20
> > startDocument (XmlProcessor processor, String pubid, URL sysid)=
;
>=20
> Question: what if there's no <!DOCTYPE? And if there is, you might =
as
> well throw in the root doctype.

Agreed. We can take it out, since the same information is available
using getPublicId() and getSystemId() in the XmlProcessor interface.

> > public void
> > startProlog (XmlProcessor processor);
> > public void=20
> > endProlog (XmlProcessor processor);
>=20
> Lose these; they have no place in this API. You want this kind of s=
tuff,
> use Lark or AElfred or whatever.

Agreed.

> > public void=20
> > processingInstruction (XmlProcessor processor, String target, S=
tring data);

I disagree -- processing instructions are an essential part of a
document (especially for architectural forms).

> > public void=20
> > error (XmlProcessor processor, String message, URL url, int lin=
e);
> >}
>=20
> Have to add the entity ID as an argument. No point giving the line=20=

> number if you don't know what it's in.

The URL argument will show you where it is.

> And one last thing: if you use URL, then you have to do a new URL()
> which does (I think) at least some syntax checking... is this approp=
riate?
> Why not just pass it as a string? -Tim

For starting =C6lfred, I found using a string awkward, since I needed a=

base URL to resolve relative URLs (like file names). Since XML
mandates URIs anyway, and Java supports them pretty transparently, I
thought that it made sense to use them directly instead of using a lot
of Url.toString() and new URL(String) calls (it will also allow the
use of '=3D=3D' with system identifiers).

All the best,

David

--=20
David Megginson ak117@freenet.carleton.ca
Microstar Software Ltd. dmeggins@microstar.com
http://home.sprynet.com/sprynet/dmeggins/