![]() |
vendredi 18 juillet 2003 |
Handful of XMLSome quick notes on a few XML articles that I refer others to...First, I really like Bob DuCharme's article on RDFLib. Those Python code snippets make me want to weep, after all the time I've spent in Mozilla's cumbersome JavaScript binding to the RDF service. Equally, I like the three code snippets he shows at the end, proving why RDF is more than XML: three ways to express the model, and all three can get merged into one graph. XML.com had two articles on the subject of generating form UIs from schema definitions. The first, written last year by Chimezie Ogbuji from FourThought and titled Editing XML Data Using XUpdate and HTML Forms, shows how to generate HTML form elements from schema definitions using XSLT. The article shows not just creation of new documents, but editing existing ones. For the latter, Chime also hints at how to use XUpdate to find the nodes you changed, and communicate only the changes to the server, who applies the xupdate in diff/patch fashion. The second article, "Web-based XML Editing with W3C XML Schema and XSLT", is more specific. Actually it is two articles, part one and part two. How does the form machinery, called XSLGUI, grab data from the existing instance document? "...the XSLGUI sets the name of each form element that it makes for each element equal to the XPath position of that element in the XML document". Here's what it looks like:
<input name="/person/phone[2]" value="0630458920"/> The page shows the full example of the XSLT for the form. The first article also shows what an XUpdate document looks like. Part 2 of the series goes into MetaXSLGUI, which is kind of like Formulator. Instead of writing the form manually, you generate it using some hints. I like MVC, I like interop, and I like to leverage industry trends, as do others. Thus, I'm interested in ways to have multiple "VC" approaches to go with Zope 3's "M" and "VC". Particularly "VC" approaches that run outside of the Zope 3 architecture, to truly show that Zope 3 isn't a closed black box. You can indeed use other technologies with Zope 3 by means of standard protocols. On my OS X box here I have a prototype of such a beastie. It uses DAV to make the remote "M" in Zope 3 a local DOM in IE 6 and Mozilla. Basically I have a local "M" to go with the remote "M". As you navigate via DAV, you grab more data from the remote "M" and shove it into the local "M", then use XSLT and JS to redraw the screen. Which, since it happens in around 12 milliseconds, isn't noticeable to the user. And since the much-maligned XSLT has kung foo powers that border on the insane, you have a rich palette of options. You already some huge performance wins. The screen isn't repainting all the time, so the user has an immediate since of responsiveness. If they are returning to a folder they've already visited, they don't have to go to the server. In fact, when running as a Moz chrome app, you can have a tree with multiple servers. But I'm really interested in the next steps. DAV gives me a rich metamodel based on namespaces. When the author makes a change in the "VC", we don't do some weird out-of-band form submission. We also don't do a remote procedure call, which I've came out the closet this week and said I don't like. Instead, we just change the local "M" and let it handle updating the remote "M" (using PROPPATCH, or MOVE, or DELETE.) We can also look at some of Jon Udell's ideas on tapping into XPath for navigation purposes. I'm pretty convinced that trees are inadequate as the only navigation path. Jon's articles provoke a number of ways to build new ways to move around inside a pile of content.
And finally, these form ideas hint at solving one of the last problems: what if
the thing you want to edit isn't a document? |
ZODB 3.3a1Tim Peters announced yesterday the first alpha of ZODB 3.3, which backports some of the work happening in ZODB4. This version leverages (and requires) Python 2.3, giving in return the elimination of ExtensionClass.
I wonder: would this make a Jython version of ZODB more likely? Don't know if
Jython is in sync with the CPython 2.3 yet. |