/** * Returns whether or not XSLT 2.0 is supported, by asking the underlying * {@link TransformerFactoryChooser}. */ public boolean supportsXSLT20() { ensureChooserSpecified(); return transformerFactoryChooser.isXSLT20SupportAvailable(); }
/** * Creates a new {@link SnuggleEngine} using a very simple internal cache for any * XSLT stylesheets required that simply stores them internally for the lifetime * of the engine. The {@link DefaultTransformerFactoryChooser} is used to choose * XSLT implementations. * <p> * This will be fine in most cases. If you want more control over * this, consider the alternative constructor. */ public SnuggleEngine() { this(DefaultTransformerFactoryChooser.getInstance(), new SimpleStylesheetCache()); }
/** * Writes out the "default" CSS stylesheet specified via {@link #readBuiltinInlineCSSProperties()}, * returning the result as a String. */ public static String writeDefaultStylesheet() { return writeStylesheet(readBuiltinInlineCSSProperties()); }
/** * Returns whether to use named entities for certain MathML symbols rather than * numeric character references. * <p> * Default is false. */ public boolean isUsingNamedEntities() { return serializationOptions.isUsingNamedEntities(); }
/** * Sets the encoding for the resulting serialized XML. * <p> * Must not be null. * * @param encoding encoding to use, which must be non-null and recognised by the XSLT * {@link TransformerFactory} that will end up doing the serialization. */ public void setEncoding(String encoding) { serializationOptions.setEncoding(encoding); }
/** * Gets the public identifier to use in the resulting DOCTYPE declaration, * as described in {@link OutputKeys#DOCTYPE_PUBLIC}. * <p> * Default is null */ public String getDoctypePublic() { return serializationOptions.getDoctypePublic(); }
/** * Gets the system identifier to use in the resulting DOCTYPE declaration, * as described in {@link OutputKeys#DOCTYPE_SYSTEM}. * <p> * Default is null */ public String getDoctypeSystem() { return serializationOptions.getDoctypeSystem(); }
/** * Returns whether the resulting XML will be indented or not. * (This depends on how clever the underlying XSLT engine will be!) * <p> * Default is false. */ public boolean isIndenting() { return serializationOptions.isIndenting(); }
/** * Sets whether to include an XML declaration on the resulting output. * * @param includingXMLDeclaration true to include an XML declaration, false otherwise. */ public void setIncludingXMLDeclaration(boolean includingXMLDeclaration) { serializationOptions.setIncludingXMLDeclaration(includingXMLDeclaration); }
/** * Sets the system identifier to use in the resulting DOCTYPE declaration, * as described in {@link OutputKeys#DOCTYPE_SYSTEM}. * * @param doctypeSystem system identifier to use, null for no identifier. */ public void setDoctypeSystem(String doctypeSystem) { serializationOptions.setDoctypeSystem(doctypeSystem); } }
private Properties getCurrentInlineCSSProperties() { if (currentInlineCSSProperties==null) { currentInlineCSSProperties = CSSUtilities.readInlineCSSProperties(options); } return currentInlineCSSProperties; }
/** * Sets the public identifier to use in the resulting DOCTYPE declaration, * as described in {@link OutputKeys#DOCTYPE_PUBLIC}. * * @param doctypePublic public identifier to use, null for no identifier. */ public void setDoctypePublic(String doctypePublic) { serializationOptions.setDoctypePublic(doctypePublic); }
/** * Obtains the XSLT stylesheet at the given ClassPathURI, using the {@link StylesheetCache} * (if set) to cache stylesheets for efficiency. * * @param classPathUri location of the XSLT stylesheet in the ClassPath, following the * URI scheme in {@link ClassPathURIResolver}. * * @return compiled XSLT stylesheet. */ public Templates getCompiledStylesheet(final String classPathUri) { return getCompiledStylesheet(classPathUri, false); }
/** * Obtains the XSLT stylesheet at the given ClassPathURI, using the {@link StylesheetCache} * (if set) to cache stylesheets for efficiency. * * @param classPathUri location of the XSLT stylesheet in the ClassPath, following the * URI scheme in {@link ClassPathURIResolver}. * * @return compiled XSLT stylesheet. */ public Templates getStylesheet(final String classPathUri) { return getStylesheet(classPathUri, false); }
/** * Creates a new {@link SnuggleEngine} using a very simple internal cache for any * XSLT stylesheets required that simply stores them internally for the lifetime * of the engine. The {@link DefaultTransformerFactoryChooser} is used to choose * XSLT implementations. * <p> * This will be fine in most cases. If you want more control over * this, consider the alternative constructor. */ public SnuggleEngine() { this(DefaultTransformerFactoryChooser.getInstance(), new SimpleStylesheetCache()); }
/** * Returns whether or not XSLT 2.0 is supported, by asking the underlying * {@link TransformerFactoryChooser}. */ public boolean supportsXSLT20() { ensureChooserSpecified(); return transformerFactoryChooser.isXSLT20SupportAvailable(); }
/** * Writes out the "default" CSS stylesheet specified via {@link #readBuiltinInlineCSSProperties()}, * saving the results to the given {@link OutputStream}. */ public static void writeDefaultStylesheet(OutputStream cssOutputStream) { writeStylesheet(readBuiltinInlineCSSProperties(), cssOutputStream); }
/** * Returns whether to use named entities for certain MathML symbols rather than * numeric character references. * <p> * Default is false. */ public boolean isUsingNamedEntities() { return serializationOptions.isUsingNamedEntities(); }
/** * Creates a new {@link SnuggleEngine} using a very simple internal cache for any * XSLT stylesheets required that simply stores them internally for the lifetime * of the engine. The {@link DefaultTransformerFactoryChooser} is used to choose * XSLT implementations. * <p> * This will be fine in most cases. If you want more control over * this, consider the alternative constructor. */ public SnuggleEngine() { this(DefaultTransformerFactoryChooser.getInstance(), new SimpleStylesheetCache()); }
/** * Returns whether or not XSLT 2.0 is supported, by asking the underlying * {@link TransformerFactoryChooser}. */ public boolean supportsXSLT20() { ensureChooserSpecified(); return transformerFactoryChooser.isXSLT20SupportAvailable(); }