Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Subclass of Element does not propagate to Document

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Fred Baube <fbaube AT saunalahti.fi>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] Subclass of Element does not propagate to Document
  • Date: Mon, 12 Mar 2007 17:29:18 +0200

I'm trying to
1) subclass nu.xom.Element with a class named my.MElm, and
2) ensure that the nu.xom.Document that XOM builds for me
uses my MElm's rather than nu.xom.Element's.

According to the text at http://www.xom.nu/tutorial.xhtml#d0e1424
("Factories, Filters, Subclassing, and Streaming"), I also have to
subclass NodeFactory. I do this, calling it my.MNodeFactory.

So, in method my.MNodefactory.startMakingElement(String NS_URI,
String name) , I return an instance of my.MElm.

I verify downstream that XOM accepted this instance of the subclass,
and I finish the element like so:

finishMakingElement(nu.xom.Element E) {
assert (E instanceof my.Elm); // succeeds
return (super.finishMakingElement (E));
}

But when I obtain the Document that is created by XOM, I find that
the nodes in the document are instances of nu.xom.Element, not my.Elm.

Is there something else I need to do to ensure that the Document that
is output by XOM is made of instances of my subclass rather than of
nu.xom.Element ?


thanks

fred

--
F.Baube
fbaube#saunalahti.fi
gsm +358 41 536 8192
wmd 60°11'10.8"N 24°57'36.9"E





Archive powered by MHonArc 2.6.24.

Top of Page