Hi everybody, i have this code here but the document.getXMLEncoding() always return null !
Any idea ?
Document document = DocumentHelper.createDocument();
Element rootElement = document.addElement
("root");
Element testNode = rootElement.addElement("testNode").addAttribute("name","Praveen");
Element author1 = rootElement.addElement("author").addAttribute("name","James").addAttribute("location","UK").addText("James Strachan");
author1 = rootElement.addElement("author").addAttribute("name","James").addAttribute("location","UK").addText("James Strachan");
author1 =
rootElement.addElement("author").addAttribute("name","James").addAttribute("location","UK").addText("James Strachan");
//for deleting node
testNode.detach();
try{
FileWriter out = new FileWriter("foo.xml");
//OutputFormat outformat =OutputFormat.createCompactFormat();
OutputFormat outformat =
OutputFormat.createPrettyPrint();
XMLWriter writer = new XMLWriter(out, outformat);
writer.write(document);
System.out.println(document.getXMLEncoding());
writer.close
();
}
catch(Exception e){
e.printStackTrace();
}
- [dom4j-user] document.getXMLEncoding() always return null Ziad EL KHATIB
- [dom4j-user] document.getXMLEncoding() always return n... Ziad EL KHATIB
- Re: [dom4j-user] document.getXMLEncoding() always ... Edwin Dankert
- Re: [dom4j-user] document.getXMLEncoding() alw... Ziad EL KHATIB
- Re: [dom4j-user] document.getXMLEncoding()... Edwin Dankert
- Re: [dom4j-user] document.getXMLEncod... Ziad EL KHATIB
- Re: [dom4j-user] document.getXMLE... Maarten Coene