Re: [dom4j-user] Add a node if it doesn't exist...

2010-04-23 Thread Filip Jirsák
Hello David, in case you know parent node is element, you can change type of variable: Element parentElement = (Element) parentNode; But with dom4j you should better do this: private static void updateNode(Document document, String elementName, String text) { Namespace xdp = Namespace.get("x

[dom4j-user] Add a node if it doesn't exist...

2010-04-22 Thread David Bates
Hey guys,   This is driving me nuts.  I’m trying to write a method which will update the an element’s text.  However, if the element doesn’t yet exist, I want to create it.  How are you meant to do this??!     private static void updateNode(Document d, String elementName, String