Just to make sure you aren't having the same confusion I had when I first started with Dom4J (and with Java)... If you're looking for the concrete implementation so that you can instantiate it -- e.g. "new Element();" -- don't. When using an interface oriented API like Dom4J (or Xerces) you use a Factory (from the Factory design pattern) to get instances of the object you want. Take a look at the classes DocumentHelper and DocumentFactory in the org.dom4j package. You can also just create a Document using the factory, get a reference to its root Element, and then use the addElement, addAttribute, etc. methods from there.

Hope this wasn't all old news...

b


gary wang wrote:
Hello everyone:
When I read the source codes of dom4j, I hava a problem.
The interfaces of Document, Element, and so on, are just interface, I can not find the concrete implement codes of methods in these interface. Where are they?
Actually, the problem confused me so much. When I read the source codes of Xerces, I also can't find the concrete implement codes of interfaces.
Thanks for help.
Best regards!
Gary


------------------------------------------------------------------------
Do you Yahoo!?
Meet the all-new My Yahoo! <http://my.yahoo.com> – Try it today!


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to