[jdom-interest] Attribute defaults

rpcee rpcee at operamail.com
Tue Nov 20 08:28:31 PST 2001


I guess the type information should not generally be held in Attribute, 
Element, etc because it will expand the interfaces and because DTDs schemas 
RELAX etc will all have a different view of metadata. I don't know if default 
value counts as metadata. If you know what attributes you want to omit if they 
have the default value perhaps you could override printAttributes() in 
XMLOutputter.

>===== Original Message From Tom Dimock <tad1 at cornell.edu> =====
>In the project I'm working on, many of the elements have attributes which
>are normally set to the default value from the DTD.  When I load this XML
>in with JDOM and then write it out again, the size of the XML file doubles,
>because JDOM writes out all of these attributes which were defaulted in the
>original file.  Now, I know that JDOM does not have the necessary knowledge
>of the DTD or XML schema to be able to deal with this, but I'd really like
>to be able to save my JDOM tree in the more compact form.  Would there be
>any interest in allowing Attribute objects to optionally have a default
>field, which could be used to suppress output of the attribute?
>
>I know this was a major feature of the early work by Sun in trying to
>XML-serialize Swing objects, which have huge numbers of attributes, most of
>which were usually default values.
>----------------------------------------------------------------------------
>       Tom Dimock  ----  Cornell University  ----  tad1 at cornell.edu
>"There go my people.  I must follow them, for I am their leader."  M. Gandhi
>_______________________________________________
>To control your jdom-interest membership:
>http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost
.com




More information about the jdom-interest mailing list