[alicebot-archcomm] Whitespace clarification

Dr. Rich Wallace alicebot-archcomm@list.alicebot.org
Mon, 15 Sep 2003 16:17:58 -0700 (PDT)


I'm not completely sure I understand the issue here, but it defies common
sens to parse all CDATA.  Sometimes "unmarked" text contains multiple
white spaces on purpose.  Properly formatted English paragraphs are
supposed to have two whitespaces at the end of every sentence.  If
wrapping this plain text paragraph in a <template> (or for that matter a
<p>) tag is going to compress sentence-ending dual-whitespaces into single
ones, it sort of defeats the purpose of text "markup" IMHO.

>
>> I'm not sure how current interpreters deal with this, and I'm
>> also not sure
>> about the whole concept of ignorable whitespace in the XML
>> specification ..
>> does the AIML spec imply that all ignorable whitespace is already
>> stripped from the content before applying rules in section 2.10?
>
> I'd say that the rules for whitespace handling in the spec are only
> trying to explain what's in the XML standard in a more straightforward
> way, ie. there are no additional whitespace handling rules in AIML (but
> I could be mistaken).
>
>> If I have the following category, will the predicate's string be " a
>> test",
>> " a test ", "a test ", or "a test"? And what would the template string
>> be?
>>
>> <template>{newline}
>> {tab}<set name="predicate">{newline}
>> {tab}{tab}a test{newline}
>> {tab}</set>{newline}
>> </template>
>
> "a test", both the variable and the resulting template. I have a feeling
> that whitespace between elements doesn't count at all, only whitespace
> between an element and element content, and only if it's separating
> content (after the elements are processed). This would mean (if I'm
> correct) that when you write
>
> <template>{newline}
> {tab}<set name="predicate">{newline}
> {tab}{tab}a test{newline}
> {tab}</set>{newline}
> for whitespace{newline}
> </template>
>
> you'd get "a test" in the variable and "a test for whitespace" as the
> output. I'll check it with the XML spec but I think I got it more or
> less right - what it basically comes down to is that you have no
> whitespace besides spaces, and only one consecutive space, and no
> whitespace at the beginning or the end (works for both variables and
> templates as a whole).
>
> Kim
>
> _______________________________________________
> alicebot-archcomm mailing list
> alicebot-archcomm@list.alicebot.org
> http://list.alicebot.org/mailman/listinfo/alicebot-archcomm


-- 
Dr. Rich
W A L L A C E
ALICE A.I. Foundation
drwallace@www.alicebot.org
"Dean of cheezo-hobby system hackers."--Salon