[REBOL] Re: XML examples?
From: gavin:mckenzie:sympatico:ca at: 22-Sep-2001 7:27
A *real* (W3C) XML-DOM is certainly the industrial strength way to
manipulate an XML document. But, it sure is a very low-level interface, and
not very easy to use. Plus, all the XML-DOM interfaces constitute quite a
bit of hefty overhead for node management etc., where REBOL has already has
a set of collection types (blocks).
In my work-life I work with real XML-DOMs (and XPath and XSLT and...), but
the XML-DOM is almost always used just as the low-level storage for the
document with a higher-level custom DOM interface that corresponds to the
type of document you are manipulating.
For instance, if you were processing a particular flavour of XML documents
(say banking transactions), building a set of objects that represent those
transactions and layering that on top of a W3C XML-DOM gives you a nice
high-level interface over the otherwise painfully low-level W3C XML-DOM.
I created xml-to-object for sorta the same reason. Despite two years of
tinkering with REBOL, I still find navigating through complex block
hierarchies tedious. The basic blocked result set from parse-xml is (most
of the time) really too high-effort for me to manipulate XML documents. For
task at hand, I simply needed a way to be able easily address the content of
some known XML document types. REBOLs path syntax is like a small subset of
XML's XPath. Hence, by using a couple of basic principles for how to map
XML elements, attributes, and mixed-content into REBOL objects, I gain the
ability to use the REBOL path syntax for interpreting the content.
Though, as it stands, xml-to-object really is only useful for addressing XML
document content. There's nothing there to help you with actually making
changes to the XML content and writing it back out.
Anyway...interesting discussion. I can't say that I had thought about
creating a real W3C XML DOM on top of REBOL.
I'm curious as to what sort of XML applications people are building with
REBOL. A better understanding of the type of XML applications people are
building should indicate what type of REBOL XML processing tools we need.
Gavin.
P.S. Mike has found a nasty bug in my xml-to-object script. I've got some
bug fixing to do.