/** * Creates a well-formed external general parsed entity out of the currently parsed tokens. * <p> * The given {@link XMLStringOutputOptions} Object is used to configure the process. * * @param options {@link XMLStringOutputOptions} to use, which must not be null. * * @return resulting XML if the process completed successfully, null if the process was * terminated by an error in the input LaTeX and if the session was configured to fail on * the first error. */ public String buildXMLString(final XMLStringOutputOptions options) { ConstraintUtilities.ensureNotNull(options, "XMLStringOutputOptions"); DocumentBuilder documentBuilder = XMLUtilities.createNSAwareDocumentBuilder(); Document document = documentBuilder.newDocument(); Element temporaryRoot = document.createElement("root"); document.appendChild(temporaryRoot); if (!buildDOMSubtree(temporaryRoot, options)) { return null; } return XMLUtilities.serializeNodeChildren(getStylesheetManager(), temporaryRoot, options); }
/** * Creates a well-formed external general parsed entity out of the currently parsed tokens. * <p> * The given {@link XMLStringOutputOptions} Object is used to configure the process. * * @param options {@link XMLStringOutputOptions} to use, which must not be null. * * @return resulting XML if the process completed successfully, null if the process was * terminated by an error in the input LaTeX and if the session was configured to fail on * the first error. */ public String buildXMLString(final XMLStringOutputOptions options) { ConstraintUtilities.ensureNotNull(options, "XMLStringOutputOptions"); DocumentBuilder documentBuilder = XMLUtilities.createNSAwareDocumentBuilder(); Document document = documentBuilder.newDocument(); Element temporaryRoot = document.createElement("root"); document.appendChild(temporaryRoot); if (!buildDOMSubtree(temporaryRoot, options)) { return null; } return XMLUtilities.serializeNodeChildren(getStylesheetManager(), temporaryRoot, options); }
/** * Creates a well-formed external general parsed entity out of the currently parsed tokens. * <p> * The given {@link XMLStringOutputOptions} Object is used to configure the process. * * @param options {@link XMLStringOutputOptions} to use, which must not be null. * * @return resulting XML if the process completed successfully, null if the process was * terminated by an error in the input LaTeX and if the session was configured to fail on * the first error. */ public String buildXMLString(final XMLStringOutputOptions options) { ConstraintUtilities.ensureNotNull(options, "XMLStringOutputOptions"); DocumentBuilder documentBuilder = XMLUtilities.createNSAwareDocumentBuilder(); Document document = documentBuilder.newDocument(); Element temporaryRoot = document.createElement("root"); document.appendChild(temporaryRoot); if (!buildDOMSubtree(temporaryRoot, options)) { return null; } return XMLUtilities.serializeNodeChildren(getStylesheetManager(), temporaryRoot, options); }
/** * Convenience method to create a well-formed external general parsed entity out of the * currently parsed tokens. * <p> * The given {@link DOMOutputOptions} Object is used to configure the process. * * @param indent whether to indent the resulting XML or not * * @return resulting XML if the process completed successfully, null if the process was * terminated by an error in the input LaTeX and if the session was configured to fail on * the first error. * * @deprecated Use {@link #buildXMLString(XMLStringOutputOptions)} instead. */ @Deprecated public String buildXMLString(final DOMOutputOptions options, final boolean indent) { DocumentBuilder documentBuilder = XMLUtilities.createNSAwareDocumentBuilder(); Document document = documentBuilder.newDocument(); Element temporaryRoot = document.createElement("root"); document.appendChild(temporaryRoot); if (!buildDOMSubtree(temporaryRoot, options)) { return null; } SerializationSpecifier serializationOptions = new SerializationOptions(); serializationOptions.setEncoding(XMLStringOutputOptions.DEFAULT_ENCODING); serializationOptions.setIndenting(indent); return XMLUtilities.serializeNodeChildren(getStylesheetManager(), temporaryRoot, serializationOptions); }
/** * Convenience method to create a well-formed external general parsed entity out of the * currently parsed tokens. * <p> * The given {@link DOMOutputOptions} Object is used to configure the process. * * @param indent whether to indent the resulting XML or not * * @return resulting XML if the process completed successfully, null if the process was * terminated by an error in the input LaTeX and if the session was configured to fail on * the first error. * * @deprecated Use {@link #buildXMLString(XMLStringOutputOptions)} instead. */ @Deprecated public String buildXMLString(final DOMOutputOptions options, final boolean indent) { DocumentBuilder documentBuilder = XMLUtilities.createNSAwareDocumentBuilder(); Document document = documentBuilder.newDocument(); Element temporaryRoot = document.createElement("root"); document.appendChild(temporaryRoot); if (!buildDOMSubtree(temporaryRoot, options)) { return null; } SerializationSpecifier serializationOptions = new SerializationOptions(); serializationOptions.setEncoding(XMLStringOutputOptions.DEFAULT_ENCODING); serializationOptions.setIndenting(indent); return XMLUtilities.serializeNodeChildren(getStylesheetManager(), temporaryRoot, serializationOptions); }
/** * Convenience method to create a well-formed external general parsed entity out of the * currently parsed tokens. * <p> * The given {@link DOMOutputOptions} Object is used to configure the process. * * @param indent whether to indent the resulting XML or not * * @return resulting XML if the process completed successfully, null if the process was * terminated by an error in the input LaTeX and if the session was configured to fail on * the first error. * * @deprecated Use {@link #buildXMLString(XMLStringOutputOptions)} instead. */ @Deprecated public String buildXMLString(final DOMOutputOptions options, final boolean indent) { DocumentBuilder documentBuilder = XMLUtilities.createNSAwareDocumentBuilder(); Document document = documentBuilder.newDocument(); Element temporaryRoot = document.createElement("root"); document.appendChild(temporaryRoot); if (!buildDOMSubtree(temporaryRoot, options)) { return null; } SerializationSpecifier serializationOptions = new SerializationOptions(); serializationOptions.setEncoding(XMLStringOutputOptions.DEFAULT_ENCODING); serializationOptions.setIndenting(indent); return XMLUtilities.serializeNodeChildren(getStylesheetManager(), temporaryRoot, serializationOptions); }