Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Serializing subtrees: possible behavior changes

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: [XOM-interest] Serializing subtrees: possible behavior changes
  • Date: Sat, 21 Jan 2006 11:56:40 -0500

Consider a document like this:

<root xmlns="http://www.example.org/"; xmlns:pre="http://www.foo.com";>
<a><b pre:c="bar"/></a>
</root>

Currently if you serialize just the a element by itself (which requires subclassing since the relevant method is not public) you get this:

<a><b pre:c="bar"/></a>

That is, you do not get the necessary namespace declarations. I am considering a change which would include the necessary namespace declarations in that case. i.e. the output would be:

<a xmlns="http://www.example.org/";><b pre:c="bar" xmlns:pre="http://www.foo.com"/></a>

There are some other changes that would affect exactly where and when particular content is written. For example some indentation logic would go into writeStartTag and writeEndTag instead of writeElement. Furthermore a start-tag might not actually be written until its the next node or its end was seen. None of these would affect the public API, only the protected API. Is anyone besides Wolfgang subclassing Serializer?

--
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



  • [XOM-interest] Serializing subtrees: possible behavior changes, Elliotte Harold, 01/21/2006

Archive powered by MHonArc 2.6.24.

Top of Page