Hi,
Try this:

StringWriter sw = new StringWriter();
serializer.transform(new DOMSource(nl.item(i)), new StreamResult(sw));
String result = sw.toString();

Good luck.
 

Felix Garcia Romero wrote:

 How can I pass a NodeList to String, in the samples the code to generate the result to console output is:  NodeList nl=......  int n=nl.getLength();
  for (int i=0;i<n ; i++)
  {
   serializer.transform(new DOMSource(nl.item(i)), new StreamResult(System.out));

  } How can I do to set the result in a String instead of System.out.Thanks in advance

Reply via email to