[jsword-devel] Streamlining of Commons

Troy A. Griffitts scribe at crosswire.org
Wed Sep 22 01:31:39 MST 2004


Joe and co.,
	If your parser claims to be DOM Level 2 compliant it needs to support 
Node::importNode for doing this.  Many parsers, a few years back, were 
not level 2 compliant.  Here is an example of code that will fail on 
these parsers (and is exactly what I think Joe wants to do by moving 
nodes between trees).

Node newNode = tree2Node.getOwnerDocument().importNode(tree1Node, true);
tree2Node.appendChild(newNode);

	Hope this helps and isn't totally off the wall.

		-Troy.



Joe Walker wrote:
> We used to use DOM for parsing most things but there was a major flaw
> - it was not possible to move nodes from one tree to another which is
> easy with JDOM. I would be hesitant about ditching JDOM without us
> knowing that this problem is fixed.
> 
> Joe.
> 
> On Tue, 21 Sep 2004 13:28:27 -0400, DM Smith <dmsmith555 at yahoo.com> wrote:
> 
>>I have streamlined JSword by eliminating the dependency upon apache
>>commons and log4j. I also finished the elimination of winlaf (it was
>>still in the build and the jnlp file).
>>
>>Turns out our use of commons was fairly trivial and in most cases
>>represented a capability that is now present in Java 1.4.
>>I did add a few methods to StringUtil and to ClassUtil. And I replace
>>the for Enums with the same Type Safe Enumeration I had created elsewhere.
>>
>>These jars total about 550K. Net result is that BibleDesktop is under
>>1.8M (it wen up to about 2.3 when lucene was added)
>>
>>The only other jar that commons depends upon is jdom and it is about 150K.
>>
>>WRT using commons.jar with FlashCard, the changes that have been done
>>mean that it will not need jdom.jar.
>>
>>I am wondering how it differs from the built-in dom that's in Java 1.4.
>>Does it add value over that?
>>
>>I have used Java 1.4's DOM to do the same kind of thing that JDom is
>>being used for.
>>
>>I am in the process of checking in the changes now.
>>
>>_______________________________________________
>>jsword-devel mailing list
>>jsword-devel at crosswire.org
>>http://www.crosswire.org/mailman/listinfo/jsword-devel
>>
> 
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel



More information about the jsword-devel mailing list