"Lars Preben S. Arnesen" <[EMAIL PROTECTED]> writes:
> [ Jason E. Stewart ]
>
> > I really think you're making a mistake. If you don't check the user's
> > input what are you supposed to do when they make a mistake? Are you
> > going to output the error from the parser saying: 'Invalid document'
> > --> not very helpful.
>
> Generally I agree, but there are only a handful of people that are
> going to use this script. They are expert users and should be able to
> give valid data.
OK. That sounds a lot better...
> A nicer solution would be to use the dtd for manual validation for
> each attribute. What's the most elegant way to implement this? I don't
> want any data rules in my script so when I check an attribute I have
> to do this based on the current dtd.
Hmmmm....
DTD's are a real pain. The weakest point of either of the two XML
API's (SAX or DOM) is DTD handling.
Xerces has a lot of internal stuff for parsing and keeping the DTD's
memory resident, but I can't give you a lot of help their. You can
always try asking on the Xerces-C list (since the Xerces.pm API is a
nearly 1-to-1 mapping of the Xerces-C API).
You may also want to look into using schemas. They will be much better
supported than DTD's. Basically DTD's are an anomaly that will go away
as soon as the schema standard is agreed upon.
my $0.05,
jas.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]