Kjetil Kjernsmo wrote:
No, not really. You'd need to have a DTD (or XML Schema, but lets not go there) declaring in which elements is whitespace significant and in which it isn't. The parser would then need to be setup to perform validation, and then it would need to be PerlSAX2 conformant on that detail (I know XML::SAX::Expat is because it's free with XML::Parser, not sure about the others). So it's a bit more complex, and you don't get to pick whitespace chars other than those defined as such in XML.On Tuesday 28 January 2003 16:15, you wrote:If I understand the problem correctly, the processor should declare what characters should be treated as whitespace, right? That's the ideal situation.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.
...how about the taglib helpers removing at least leading and trailing \s's unless the element has an xml:space="preserve"-attribute?I'd say that having a way of telling the taglib helpers that "in this element, whitespace is irrelevant" would be helpful because people are bound to be bitten by that and not necesarily know why because programming habits get us into the habit that indentation is irrelevant (except in That Other Language, but well...). I'm not sure that paying attention to xml:space is useful though, it's probably something that can be simply specified at the taglib level (makes it easier too).
Collapsing multiple \s's to a single space is also a possibility.
Taglib helpers doing that would simply s/^\s*//, s/\s*$//, and s/\s+/ /.
I mean, the main purpose of the taglib helpers is to make working with taglibs easier, not provide a rigorous implementation of XML details?I think they should be rigorous, but playing with the whitespace at the application level is no breach to XML.
--
Robin Berjon <[EMAIL PROTECTED]>
Research Engineer, Expway http://expway.fr/
7FC0 6F5F D864 EFB8 08CE 8E74 58E6 D5DB 4889 2488
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
