Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] User Questions

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: Peter Murray-Rust <pm286 AT cam.ac.uk>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] User Questions
  • Date: Wed, 03 Aug 2005 17:20:48 -0400

Peter Murray-Rust wrote:
My questions include:

* is it a good idea to subclass Document to CMLDocument? (I had to do
this for W3C as it was the only way to to create subclasses).

It's not really necessary. You might do it if it helped you distinguish your CML documents from all others, or if you wanted to guarantee somehow that CML documents only contained the proper root element. However, that's stretching a bit.

* What is the role of a Document (it is much less central than in W3C).
Obviously it holds the prolog, etc. I note that it cannot be detached
from its rootElement. (I sometimes need to replace a rootElement with
its child, and this seems to be forbidden without copying the tree.

It's the root node, nothing more. It's like the root node in XPath (except that it can have a DocType child.)

* Is is possible to serialize a Node other than document without making
a copy?

Not directly, but you can subclass serializer to expose some protected methods as Wolfgang said. Use cases might convince me to make some more methods public.

* Is there a simple way to run schematron from within XOM? I can build
up the XSLT transform, but wonder if there is something prettier.

No. You'd pretty much have to go the XSLT route.

* is there every likely to be support for W3C dataTypes in XOM. At
present I create my own subclasses (e.g. Integer, IntegerList, etc).


Probably not. The added API complexity would be prohibitive. Not to mention that SAX doesn't expose schema types for XOM to use when building.


--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim





Archive powered by MHonArc 2.6.24.

Top of Page