Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Null children of Element

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Peter Murray-Rust <pm286 AT cam.ac.uk>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] Null children of Element
  • Date: Fri, 4 Sep 2009 18:12:40 +0100

I am using XOM 1.1 and (by mistake) have been able to create null children
of an element by inserting at too high a position. Should this have been
trapped in insertChild() and thrown an IndexOutOfBoundsException. The error
is exemplified by the debug printout (the fooModule are XOM Element):

LOG.debug("inserting at: "+moduleStart+" ; childCount =
"+legacyModule.getChildCount());
legacyModule.insertChild(totalRegexModule, moduleStart);
LOG.debug("childCount: "+legacyModule.getChildCount());
if (moduleStart > 0) LOG.debug("added child:
"+legacyModule.getChild(moduleStart));
LOG.debug("last child:
"+legacyModule.getChild(legacyModule.getChildCount()-1));

gives:
71 [main] DEBUG org.xmlcml.cml.converters.marker.RegexManager - inserting
at: 6 ; childCount = 3
71 [main] DEBUG org.xmlcml.cml.converters.marker.RegexManager -
childCount: 4
71 [main] DEBUG org.xmlcml.cml.converters.marker.RegexManager - added
child: [org.xmlcml.cml.element.CMLModule: module]
71 [main] DEBUG org.xmlcml.cml.converters.marker.RegexManager - last
child: null

TIA and apologies if this is a known (and corrected) bug.

P.

--
Peter Murray-Rust
Reader in Molecular Informatics
Unilever Centre, Dep. Of Chemistry
University of Cambridge
CB2 1EW, UK
+44-1223-763069



  • [XOM-interest] Null children of Element, Peter Murray-Rust, 09/04/2009

Archive powered by MHonArc 2.6.24.

Top of Page