public Document makeDocument() { Document graph = pFactory.newDocument(); List<StatementOrBundle> ll = graph.getStatementOrBundle(); Collection<Collection<StatementOrBundle>> acc = new LinkedList<Collection<StatementOrBundle>>(); overallWorkflow(acc); for (Collection<StatementOrBundle> col : acc) ll.addAll(col); graph.setNamespace(Namespace.gatherNamespaces(graph)); return graph; }
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); }
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(); }