Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XOM 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: Hugues Cassé <casse AT netcourrier.com>, xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XOM Questions
  • Date: Tue, 4 Feb 2003 06:37:43 -0500

At 1:42 AM +0100 2/4/03, Hugues Cassé wrote:
Hello,
I'm currently developping a version of XOM for the Python languages.
This work drives me to some design questions. These questions are
not criticisms but interrogations of a XOM beginner. Yet, I must
great Elliotte Rusty Harold for the XOM API design that melt
simplicity, performance (I think) and power.
Thank you in advance for the answers.

(1) Is there a technical or phylosophic reason not to use of class
iterator in XOM?

Yes. XOM strives for simplicity and language conformance. Iterators
are neither simple nor familiar to most Java programmers. They cannot
do anything a simple indexed loop can't do, so I go with the simpler
solution. Iterators might be appropriate in a language where
iterators were a first-class language construct. Is Python such a
language? I don't know. But Java is not.

(2) I have noted the following problems with the current management
of default namespaces with the current implementation of XOM (as far
as I understand well the source :))
If the read XML file is something like
<pref1:tag1 xmlns="uri2" xmlns:pref1="uri1">
<tag2/>
...
<tag2/>
</pref1:tag1>
When it will be stored, it will become:
<pref:tag1 xmlns:pref1="uri1">
<tag2 xmlns="uri2"/>
...
<tag2 xmlns="uri2"/>
</pref1:tag1>
The result may waste a lot of storage and it diverges much from
the original file, eventually making the user unhappy when it read
it back. Although it is a very special case, I'm very sensitive to
the human readibility of XML files.


That may be a bug. Do you have a simple test case?
--

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo AT metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| Processing XML with Java (Addison-Wesley, 2002) |
| http://www.cafeconleche.org/books/xmljava |
| http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://www.cafeaulait.org/ |
| Read Cafe con Leche for XML News: http://www.cafeconleche.org/ |
+----------------------------------+---------------------------------+




Archive powered by MHonArc 2.6.24.

Top of Page