commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 18397] - order of set-properties-rule execution in Digester 1.4 (1.3 as well)
Date Thu, 27 Mar 2003 07:51:34 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18397>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18397

order of set-properties-rule execution in Digester 1.4 (1.3 as well)

craig.mcclanahan@sun.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX



------- Additional Comments From craig.mcclanahan@sun.com  2003-03-27 07:51 -------
Digester is a wrapper around a SAX parser.  Therefore, the rules that are fired
receive their attribute lists as an object of type "org.xml.sax.Attributes".  If
you examine the Javadocs for this class (in the JDK 1.4 Javadocs, for example),
you will note the following statement:

  The order of attributes in the list is unspecified,
  and will vary from implementation to implementation.

Therefore, making Digester pretend that the order of attribute values is
predictable and reliable is not a good idea -- switching the underlying parser
to one that happens to provide the attributes of a particular XML element in a
different order will totally mess up an application, even if this patch were
applied.  It would also impose an unacceptable burden on the authors of the XML
documents being parsed (and the tools that the document author might be using),
because the order of attributes on an XML element is always arbitrary.

If you have order dependencies between the attributes you are trying to set, you
should really remodel the organization of your XML documents to use nested
elements instead -- then, you can use a DTD or schema to enforce the required
order.  Making the proposed change to Digester, on the other hand, is just
fool's gold that might work for one particular version of one XML parser, but
will fail for everyone else in the world (besides the fact that it would slow
down performance for everyone, even those who don't care about attribute order.)

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


Mime
View raw message