commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <skitch...@apache.org>
Subject RE: [Digester] How to turn off parse's attempt to retrieve dtd?
Date Thu, 16 Jun 2005 05:29:18 GMT
On Thu, 2005-06-16 at 01:07 -0400, Jon Steelman wrote:
> Simon,
> 
> How does one know if the DTD has nothing but validation rules?

Read the DTD and watch out for things like:

Default values for xml attributes:
  <!ATTLIST payment type CDATA "check">
which will implicitly sets xml attribute payment to "check" if the input
doesn't specify a value.

Entity definitions:
  <!ENTITY .....>

There might be a few other things that a DTD can contain which affect
the *meaning* of even a valid document. I haven't actually figured out
what the exclusive list is.

Things like ELEMENT and ATTLIST (without default values) declarations
should be ok, in that a valid document is unchanged whether the DTD is
used or not.

But::
> <!ATTLIST cardAction action (activate|deactivate|status) "activate">
there's a default value. So you can't skip the DTD completely; you'll
have to provide an EntityResolver that returns a local copy of the DTD
otherwise documents that don't define the action attribute won't get the
default value.

Regards,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message