Ejemplo n.º 1
0
 /** Transform a TinyTree to a String. */
 public static String tinyTreeToString(NodeInfo nodeInfo) {
   try {
     final Transformer identity = getXMLIdentityTransformer();
     final StringBuilderWriter writer = new StringBuilderWriter();
     identity.transform(nodeInfo, new StreamResult(writer));
     return writer.toString();
   } catch (TransformerException e) {
     throw new OXFException(e);
   }
 }
Ejemplo n.º 2
0
 /** Transform a dom4j document to a String. */
 public static String dom4jToString(Document document) {
   try {
     final Transformer identity = getXMLIdentityTransformer();
     final StringBuilderWriter writer = new StringBuilderWriter();
     identity.transform(new LocationDocumentSource(document), new StreamResult(writer));
     return writer.toString();
   } catch (TransformerException e) {
     throw new OXFException(e);
   }
 }
Ejemplo n.º 3
0
  public static String domToString(Node node) {
    try {
      Transformer transformer = TransformerUtils.getXMLIdentityTransformer();
      DOMSource source = new DOMSource(node);

      StringBuilderWriter writer = new StringBuilderWriter();
      transformer.transform(source, new StreamResult(writer));
      return writer.toString();
    } catch (TransformerException e) {
      throw new OXFException(e);
    }
  }