commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Incze Lajos <in...@mail.matav.hu>
Subject Re: cvs commit: jakarta-commons/digester/src/java/org/apache/commons/digester Digester.java
Date Mon, 14 Jan 2002 22:53:40 GMT
> > I've reread the xml 1.0 spec, too. And it is just the other 
> > way as I remembered. The 'xml:spec' value can be "default" or 
> > "preserve". The "default" (which is the default, he-he) means 
> > that the xml author accepts the application's whitespace 
> > policy. You have to specify the "preserve" attribute for the 
> > element subtree if you want to be sure that the app doesn't 
> > drop your whitespaces. (On the other hand: the automatic
> > trim() in digester is simply a bug in this respect.)
> > 
> > incze
> > 
> 
> Or, since Digester is released, it is merely a feature ;-)
> 
> This 'bug/feature' will always exist IMHO, because there are an infinite
> numbers of ways to create a SAX event stream.  Digester was built to get
> to the 'meat of the matter', ie the text in XML.  Craig correctly
> supposed that leading/trailing whitespace was not important for
> configuration-type systems.  I have a need to extend the 'text'
> definition to include whitespace, and the event producer that I use does
> not ignore this.
> 
> Scott

It's OK, but if an element has the xml:space='preserve' attribute, then
it means that the xml author definitely prohibit trimming the text nodes
in the subtree of this element. It's SAX independent, it's XML spec. So,
if the digester watches this special xml attribute, then your problem
is resolved, you simply mark the elements you want to avoid whitespace
processing by the xml:space attribute.


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

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


Mime
View raw message