Hi;

Are you saying we should code as below? Or not code as below and do it a
different way?

Thanks - dave


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Edwin Dankert
Sent: Monday, December 20, 2004 4:14 AM
To: [EMAIL PROTECTED]
Subject: Re: [dom4j-user] Two suggested improvements for dom4j

Just to make sure that nobody tries to implement the previous code.

The previous code created objects directly which bypasses the dom4j
factory and caching mechanisms. Instead of doing it that way, make
sure to always use a 'factory' method to create objects:

<code>*

Document doc = DocumentHelper.createDocument();

Element data = doc.addElement( "Data");
Element font = doc.addElement( "Font");
font.addText( DocumentFactory.createText( "hi there"));
data.addText( DocumentFactory.createText( "    "));
data.add( font);
data.addText( DocumentFactory.createText( "    "));

</code>

Code not tested.

Regards,
Edwin


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to