[jdom-interest] SAXBuilder inclusion of default attributes

Elliotte Rusty Harold elharo at metalab.unc.edu
Mon Jan 19 19:30:37 PST 2004


At 6:32 PM -0800 1/19/04, Harry Evans wrote:
>I am working with a third party data source, that submits xml to me. 
>The DTD for this submission contains several elements that have 
>attributes with default values, ie if certain attributes for an 
>element are omitted, they have a default value, as defined by the 
>DTD.
>
>I am doing some manipulation of this file and then sending it on to 
>a new destination.  However, when I use SAXBuilder to build the 
>document (even with validation off), it explicitly includes the 
>default values for omitted attributes in the Document.
>

You need to turn off not only validation but also external entity 
resolution. I think the relevant feature is 
http://xml.org/sax/features/external-general-entities
-- 

   Elliotte Rusty Harold
   elharo at metalab.unc.edu
   Effective XML (Addison-Wesley, 2003)
   http://www.cafeconleche.org/books/effectivexml            
   http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA 



More information about the jdom-interest mailing list