Hi Alan

----- Original Message -----
To: Dom4j
Sent: Wednesday, January 23, 2002 9:13 AM
Subject: [dom4j-user] Beginners Questions (Licence, JTree ..)

Hello,

            First off I am new to this list and dom4j and I am currently evaluating its use in a project. I will start by saying I think it�s a great project and seems to be exactly what I have been looking for.

            I have a couple of questions regarding the usage of dom4j, again I have read the licence and I think I understand the implications but I would like to state how I would like to use dom4j to see if there are any licence issues:

 

1) I will never ship dom4j in source code form.

2) dom4j will only exist as an internal, non API accessible part of a commercial application (user or developer will not see org.dom4j.*�)

3) The dom4j used may have modified source code (although this is highly undesirable I would endeavour to just plug-in the dom4j jar as is)

 Sounds fine.

 

dom4j has an Apache-style licence - its a BSD licence - so its totally fine to do as you wish in a commercial context.

 

Assuming all the copyrights notices are in the right place and the dom4j project is credited in documentation do you see a problem with the above usage? As you may have guessed I have to persuade management to accept the usage of dom4j.

Just tell them its legally exactly like using any other Apache product like Tomcat, Ant, JUnit, Xerces, Xalan, Crimson etc.

 

 

Ok moving on from the legal stuff� I have a more level question.

 

I am looking at the Swing sample code and trying to integrate my own swing JTree with dom4j. I am wondering is there still an issue with the �leaf� node as mentioned in a mail in the archive.

Basically my code currently loads up my XML in dom4j and then the JTree loads the model and the whole XML model is displayed correctly except �attributes�. Is there a way to get at the attributes from a branch ?

 Once you've got the Swing TreeNode you can do this...

 

LeafTreeNode treeNode = ...;

Node node = treeNode.getXmlNode();

if ( node instanceof Element ) {

    Element element = (Element) node;

    // can now access the XML attributes

    String foo = element.attributeValue( "foo" );

   

 

James

Thanks in advance.

 

 

Alan O'Leary

 

Reply via email to