[alicebot-archcomm] Whitespace clarification
Jonathan Roewen
alicebot-archcomm@list.alicebot.org
Tue, 16 Sep 2003 22:03:39 +1200
> We're the arch, here we make the rules ;-) I can explain how whitespace is
> to be handled, but i can't guarantee that it's in accordance with the
spec.
> But then, the spec is very unclear on some issues so we can just as well
> decide on what is "right" (BTW, where IS the spec?).
At alicebot.org: http://alicebot.org/TR/2001/WD-aiml-1.0.1-20011025-006.html
> 0. If a block of data is marked up by either a CDATA section or a
xml:space
> attribute, the respective XML rules apply.
> 1. Whitespace inside element content is mushed to a single space character
> 2. Whitespace that separates elements gets stripped
> 3. Whitespace between element and element content is stripped, unless it
> serves to separate textual content, in which case #1 applies.
> 4. All variable values fall under #1, with the addition of stripping any
> leading and trailing whitespace
> 5. (The "ultimate" rule) After processing the template, all leading and
> trailing whitespace is stripped, and all remaining whitespace is mushed to
a
> single space character unless it is specifically marked up, see #0 (only a
> failsafe, if rules 0-4 are applied correctly, this rule should be
> unnecessary).
Point 1 is a tiny bit unclear. This just means leading and trailing
whitespace right?
Point 2: could you give an example of which whitespace would be stripped?
Point 3: isn't this just point 2 with an extra clause?
I think some examples of how each rule applies would help ;-)
Jon