Forum OpenACS Development: Heads Up: tDOM will replace nsxml

Collapse
Posted by Bart Teeuwisse on
A heads up to all developers. Tomorrow I will commit some changes to the CVS HEAD (aka OpenACS 5.0) that will phase out nsxml in favor of tDOM (http://tdom.org).

Once committed, OpenACS will require tDOM instead of nsxml. tDOM is one of the fastest DOM/XSL/XPath implementations around. Replacing nsxml with tDOM opens the door to all sorts exciting posibilities. Examples include:

- the IRC logger at https://openacs.org/irc/log/ (currently out of order but that is a whole different story)
- amazon.com integration (see the books listed at http://www.thecodemill.biz or my wishlist at http://www.thecodemill.biz/about/bart-teeuwisse/wish-list/
- ups and fedex integration to track orders or to get quotes (long term plan),

and much more.

I also want to take this opportunity to ask for the community's input on this replacement. Changing the code is easy, the real work is in the documentation (1) and the ease of installation (2).

1) We need to change the documentation so that it refers to tDOM where it used to mention ns_xml. Which documents are affected by this change?

2) The advantage of tDOM is that it can be loaded into AOLserver 4.x with a simple 'package require' when ever needed. AOLserver 3.x however still requires a nstdom module which will need to be compiled (Instructions are included in the tDOM tar ball). Should we include tDOM in an OpenACS tarball? tDOM is not available (and will not be -as far as I know-) from AOLserver.com as it is not an exclusive AOLserver module.

Your thoughts on these questions are apreciated.

More news follows when the change has taken place. Checkout http:/tdom.org/ to familiarize your self with tDOM.

/Bart

Collapse
Posted by Bart Teeuwisse on
I've replaced nsxml with tDOM on CVS HEAD. From now on the CVS HEAD requires tDOM instead of nsxml. tDOM is available from http://tdom.org.

Please follow the installation instructions included with tDOM for AOLserver 3.x EVEN when you are running AOLserver 4.x. As package require only works in AOLserver 4.x we'll have to go with the smallest common denominator.

Checkout irc-logger (http://cvs.openacs.org/cvs/openacs-4/contrib/packages/irc-logger) for an example of how to use tDOM in OpenACS.

/Bart

Collapse
Posted by Bart Teeuwisse on
Another advantage of tDOM over nsxml is that it processes XQL files that include a DOCTYPE. If your editor can use DTDs when editing XML files this might be of interest.

I've written a DTD for XQL files, which is available from http://www.thecodemill.biz/repository/xql.dtd. A write-up of how to use this DTD in Emacs is available from http://www.thecodemill.biz/publications/xql-dtd/.

/Bart

Collapse
Posted by Steve Manning on
Bart

Not wishing to belittle your hard work but a talk I attended recently suggested that in future we should be using XML Schemas in place of DTD's. http://www.w3.org/XML/Schema

- Steve

Collapse
Posted by Bart Teeuwisse on
Steve,

I couldn't agree more. However, I do know that Emacs (and many other editor) can parse DTDs. Support for XML Schemas is spotty at this time.

When the time is right we can convert DTDs into XML Schemas using tools such as http://www.w3.org/2000/04/schema_hack/.

/Bart

Collapse
Posted by Jon Griffin on
Bart, There are a couple of typos on your xql page.

 ("XQL 1.0" "<?xml version=\"1.0\"?gt;\n<!DOCTYPE queryset PUBLIC \"-//OpenACS//DTD XQL 1.0//EN\" \"xql.dtd\"gt;" )
and could you give all of us non-lisp programmers an example of setting sgml-custom-dtd? I tried many ways and it never worked. Thanks
Collapse
Posted by Bart Teeuwisse on
Thanks for the proof reading Jon. I've corrected the typo's and included a link to a sample PSGML configuration snippet for inclusion in your .emacs file.

Please note that the URL has change to http://www.thecodemill.biz/publications/articles/xql-dtd/.

A second article is forthcoming. This article shows how can find and replace bind variables in OpenACS queries as you enter them in an interactive SQL buffer. Stay tuned!

/Bart

Collapse
Posted by Richard Hamilton on
Just been through the new docs for installing tDOM on Aolserver ad33.13 and it still refers to nsxml. It also does not refer to the need to switch the

nsparam    nsxml    ..path/bin/nsxml.so

aolserver server_config.tcl file entry for:

nsparam    libtdom  ..path/bin/libtdom.so

This might confuse newcomers.

I am assuming that nsxml does not need to be loaded any more. Will there be any errors thrown in openacs code if aolserver loads both modules at startup?

Regards
Richard

Collapse
Posted by Don Baccus on
I'm not sure if there will be errors or not ... can you file this as a documentation bug in bugtracker?  Good catch ...
Collapse
Posted by Bart Teeuwisse on
Richard,

ns_xml and tDOM can both be loaded at the same time.

/Bart

Collapse
Posted by Richard Hamilton on
Bart - thanks.

Don - I have posted it.

R.