On Tuesday 28 January 2003 16:15, you wrote:
> Yes it is. In order for whitespace to be ignored, you'd have to be
> using a DTD (and those horrors don't quite mix well with namespaces)
> and taglibs would have to be fully SAX2 (to support
> ignorable_whitespace() instead of characters()). In other words, it's
> best for you to deal with it yourself.

OK, I've been thinking a bit about this, and.... 

If I understand the problem correctly, the processor should declare what 
characters should be treated as whitespace, right? That's the ideal 
situation.

However, Perl has a simple, and probably incomplete idea of what 
whitespace is, namely \s. But for most of us, \s is the only whitespace 
we would ever have to deal with, so the idea is...

> > I seem to recall that the XML spec has a couple of things about
> > whitespace, yup, http://www.w3.org/TR/REC-xml#sec-white-space
> > Perhaps this could be made use of?
>
> Not much no, most of those rules tend to be pretty much useless in
> many cases. Whitespace is one of the Recurrent Problems People Have
> With XML.

:-) 

....how about the taglib helpers removing at least leading and trailing 
\s's unless the element has an xml:space="preserve"-attribute?
Collapsing multiple \s's to a single space is also a possibility. 

I mean, the main purpose of the taglib helpers is to make working with 
taglibs easier, not provide a rigorous implementation of XML details? 

After all, "dealing with whitespace", would usually just amount to that 
mentioned above, so wouldn't it be nice if the taglib helper did that 
by default? How hard would it be to implement? 

Cheers,

Kjetil
-- 
Kjetil Kjernsmo
Astrophysicist/IT Consultant/Skeptic/Ski-orienteer/Orienteer/Mountaineer
[EMAIL PROTECTED]  [EMAIL PROTECTED]  [EMAIL PROTECTED]
Homepage: http://www.kjetil.kjernsmo.net/        OpenPGP KeyID: 6A6A0BBC


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to