public XMLOutput(boolean includeXMLinst, String stylesheetURL) { setStylesheetURL(stylesheetURL); setIncludeXMLinst(includeXMLinst); }
/** Output a result set in the XML format, inserting a style sheet in the XML output * * @param outStream output stream * @param qresults result set * @param stylesheet The URL of the stylesheet */ static public void outputAsXML(OutputStream outStream, ResultSet qresults, String stylesheet) { XMLOutput xOut = new XMLOutput(stylesheet) ; xOut.format(outStream, qresults) ; }
/** Return a string that has the result set serialized as XML (not RDF) * with a style sheet directive inserted into the XML. * <p> * This builds the string in memory which can lead to memory exhaustion * for large results. It is generally better to use the * {@link #outputAsXML(OutputStream, ResultSet, String)} overload instead * </p> * @param qresults result set * @param stylesheet * @return string */ public static String asXMLString(ResultSet qresults, String stylesheet) { XMLOutput xOut = new XMLOutput(stylesheet) ; return xOut.asString(qresults) ; }
private Context setup() { Context cxt = ARQ.getContext().copy(); setStylesheetURL(cxt, stylesheetURL); setXMLinstruction(cxt, includeXMLinst); return cxt; } }
public XMLOutput(String stylesheetURL) { setStylesheetURL(stylesheetURL); }
@Override public void format(OutputStream out, ResultSet resultSet) { Context cxt = setup(); ResultsWriter.create() .context(cxt) .lang(ResultSetLang.SPARQLResultSetXML) .write(out, resultSet); }
public XMLOutput(boolean includeXMLinst) { setIncludeXMLinst(includeXMLinst); }
XMLOutput.setStylesheetURL(cxt, stylesheetURL);
@Override public void format(OutputStream out, boolean booleanResult) { Context cxt = setup(); ResultsWriter.create() .context(cxt) .lang(ResultSetLang.SPARQLResultSetXML) .build() .write(out, booleanResult); }
XMLOutput.setStylesheetURL(cxt, stylesheetURL);
/** Output a boolean result in the XML format * * @param outStream output stream * @param booleanResult * @param stylesheet The URL of the stylesheet */ public static void outputAsXML(OutputStream outStream, boolean booleanResult, String stylesheet) { XMLOutput xOut = new XMLOutput(stylesheet); xOut.format(outStream, booleanResult); }
/** Return a string that has the result set serialized as XML (not RDF) * <p> * This builds the string in memory which can lead to memory exhaustion * for large results. It is generally better to use the * {@link #outputAsXML(OutputStream, boolean, String)} overload instead * </p> * * @param booleanResult The boolean result to encode * @param stylesheet * @return string */ public static String asXMLString(boolean booleanResult, String stylesheet) { XMLOutput xOut = new XMLOutput(stylesheet) ; return xOut.asString(booleanResult) ; }