コード例 #1
0
 public void serialiseDocument(OutputStream out, Document graph, boolean format)
     throws JAXBException {
   Marshaller m = jc.createMarshaller();
   m.setProperty("jaxb.formatted.output", format);
   configurePrefixes(m, graph.getNss());
   m.marshal(of.createDocument(graph), out);
 }
コード例 #2
0
 public String serialiseDocument(StringWriter sw, Document graph, boolean format)
     throws JAXBException {
   Marshaller m = jc.createMarshaller();
   m.setProperty("jaxb.formatted.output", format);
   configurePrefixes(m, graph.getNss());
   m.marshal(of.createDocument(graph), sw);
   return sw.toString();
 }