[REBOL] Re: parse-xml and build-tag
From: joel:neely:fedex at: 9-Oct-2001 6:23
Hallvard Ystad wrote:
> ... digging into 'xml-language and changing the code.
>
It was fun to go back and look at that code again. I tweaked
the XML parser a few years ago (to add CDATA and PI processing)
and found it a very educational experience.
Incidentally, there is a "buglet" in XML-LANGUAGE; the word
ATTR-NAME is not placed in the object context, so using
XML-LANGUAGE creates that word in the global context...
>> value? attr-name
** Script Error: attr-name has no value.
** Where: value? attr-name
>> parse-xml {<foo when="now">Hello, world!</foo>}
== [document none [["foo" ["when" "now"] ["Hello, world!"]]]]
>> value? attr-name
== true
>> attr-name
== "when"
> This list is a wonderful place.
>
I've found it so. Even the "enthusiastic disagreements" usually
stimulate me to learn something -- or at least think things thru
more clearly. ;-)
Incidentally, I've been using "near-XHTMl" (HTML written with
XML syntax -- quoted attributes, self-delimited empty tags...)
for a few years now, and have yet to see any problems with it.
One of my motivations was to be able to use parse-xml on my
HTML documents...
-jn-
--
; Joel Neely [joel--neely--fedex--com] 901-263-4460 38017/HKA/9677
REBOL [] foreach [order string] sort/skip reduce [ true "!"
false head reverse "rekcah" none "REBOL " prin "Just " "another "
] 2 [prin string] print ""