[jdom-interest] performance with creating a document

Jason Hunter jhunter at collab.net
Mon May 21 19:09:48 PDT 2001


> the elements looks something like this
> 
> <chemmodel:chemmodel name="C101" type="distillation">
>   <chemmodel:specification name="rr" type="refluxratio" value="1.2" />
>   <chemmodel:list name="stages" set="1:25" >
>      <chemmodel:item name="1" type="stage">
>        <chemmodel:variable name="t" type="temperature" value="325.25" />
>        <chemmodel:variable name="p" type="pressure" value="1e5" />
>          <chemmodel:list name="compositions" set="water,methanol,ethanol" >
>             <chemmodel:item name="water" type="component" >
>                   <chemmodel:variable name="x" type="liquid-mole-fraction" value="0.3" />
>                 </chemmodel:item>
>            .....
>         </chemmodel:list>
>      </chemmodel:item>
>      ....
>   </chemmodel:list>
> </chemmodel:chemmodel>
> 
> So there is definitely some deep nesting, and lost of lists going on. No
> text content, lots of attributes. It is really slow to build this structure
> with Element e = new Element("list",ns);, then adding the various
> attributes, and then adding the content to the parent element.
> 
> Is there a faster way creating/populating the jdom document?

When you say slow do you mean in execution time or in lots of typing?

-jh-



More information about the jdom-interest mailing list