[Zope-dev] The future of Zope with XML
Martijn Faassen
faassen@vet.uu.nl
Sat, 3 Jun 2000 00:38:55 +0200
Kevin Dangoor wrote:
> Thanks for getting this document going. It's good to see where XML is
> going in Zope.
[note that the zope-xml list may be a better list to discuss these things;
I've cc-ed to there but we might want to move the thread there
completely]
> I do have a question, though. For me, the main value in XML has been in
> its usefulness as a flexible interchange format. Right now, I can store data
> as objects (either straight Python or ZClasses) in Zope and transform those
> into XML if I need to share it with the outside world (eg RSS).
Right, this is definitely an advantage of XML.
> Similarly,
> though I haven't done this, I believe I can take XML from the outside world,
> parse it and store it in objects in the database.
Right -- XMLDocument does this. It parses the XML into a DOM-like tree,
storing the XML nodes as objects in the database. You still get an XML
view on it, but it's actually all objects.
> Are there advantages to
> storing the data in Zope as XML vs. storing my data as objects?
It can be the same thing. :)
You can use XML to seperate content from layout in a clean fashion,
by storing document contents in an XML format, and providing a translator
of this format into HTML. Pull in the other layout components with
ordinary DTML and you have a web page. I've done this with the original
XMLDocument version. You can write the translator using DTML, using
XMLWidgets. The new XMLDocument will support DTML (and I'll work on
XMLWidgets support), and also XSLT which is a standard to transform
one XML document into another (and into HTML).
If you already decided to use XML for whatever reason, the advantages of
the ZODB come into play. Huge XML documents don't need to be loaded into
memory all at once. You can also edit smaller parts of an XML document
without disrupting the rest, making for faster editing. *and* you can
manipulate the XML document using DOM and XSLT. Since there are many XML
formats already with new ones being developed all the time, this can
potentially be a very powerful use of the ZODB.
So, if you are already using XML, Zope can be a source of power. If you're
not using XML, you might want to consider using it to store document-style
contents so you can seperate it from layout, and so that you can leverage
DOM, XPath and XSLT. It may be less useful to use XML to store other kinds
of data; that will vary on a case by case basis.
Then there are a number of vague possible future payoffs like being able to
use various XML standard to query the ZODB, provide unique
paths into it, provide pointers and linking facilities, etc.
Regards,
Martijn