cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sukkary" <>
Subject Document Object Handling
Date Thu, 19 Oct 2000 01:46:10 GMT

 Hi all,
 My main task is to traverse a Document object's DOM tree and print its TEXT
node values
 in xml file using xsp processor
 I tried to create and traverse a Document object as follows :


 public Document getDoc(){

  Document doc = xspParser.createEmptyDocument();
    doc.createTextNode("Hello From Amin");

    return doc;

public String PrintArt(Document doc){
   NodeList Art = doc.getElementsByTagName("Article");
   Node node = Art.item(0);
   NodeList Art_text = node.getChildNodes();
   node = Art_text.item(0);

return node.getNodeValue();


 !!!!!!........ but when i tried to present the text node's
 ??????........ i surprised that cocoon raise a null pointer
 which means that my created document object is empty, why?
 can any one tell me how can i create a document object that contain this
document fragment and
 present its text node contents in xml ?

M. Amin

View raw message