commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Sanders" <ssand...@nextance.com>
Subject RE: cvs commit: jakarta-commons/digester/src/java/org/apache/commons/digester Digester.java
Date Tue, 15 Jan 2002 00:23:58 GMT
> -----Original Message-----
> From: Incze Lajos [mailto:incze@mail.matav.hu] 
> > > 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.
> 

Everything you say is true.  What I was trying to say is that an XML
parser is not the ONLY way to get a SAX event stream.  You can write a
class to do it (I am doing this).  So my input is not XML, only SAX.
SAX != XML.

Scott

--
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