Class Xslt
java.lang.Object
org.libxmq.imp.xml.libxslt1.Xslt
XSLT 1.0, a port of libxslt onto the native dom and xpath (the port of
xml_libxslt1_xslt.c in the C version).
This part has the patterns (pattern.c: compilation, matching, template registration
and lookup) and the compilation of stylesheets (xslt.c, preproc.c, imports.c,
attributes.c); the transformation is in
Transform.-
Method Summary
Modifier and TypeMethodDescriptionstatic Stylesheetcompile(XmlDocument doc, Settings settings) Compile a stylesheet (libxslt xsltParseStylesheetDoc, xml_libxslt1_compile).static XmlDocumentdefaultLoader(Settings s, String uri, int type) The default loader (xml_libxslt1_default_loader): read the file (a file: url or a path) and parse it as xml, with entities expanded like libxslt XSLT_PARSE_OPTIONS.static StringstylesheetDescribe(Stylesheet style) A description of the compiled stylesheet (output settings, templates, keys, global variables, attribute sets, ...), for testing (xml_libxslt1_stylesheet_describe).static voidstylesheetFree(Stylesheet style) Free a stylesheet (xml_libxslt1_stylesheet_free), nothing to do in java.static StylesheetstylesheetNewEmpty(XmlDocument style_dom, Settings settings) An empty stylesheet whose document is style_dom (not owned), patterns can be compiled with namespaces from its elements (xml_libxslt1_stylesheet_new_empty).
-
Method Details
-
defaultLoader
The default loader (xml_libxslt1_default_loader): read the file (a file: url or a path) and parse it as xml, with entities expanded like libxslt XSLT_PARSE_OPTIONS.- Parameters:
s- The settings, where the messages go.uri- The uri.type- What it is loaded for, a Settings.LOAD_* value.- Returns:
- The document, null if it cannot be loaded.
-
stylesheetNewEmpty
An empty stylesheet whose document is style_dom (not owned), patterns can be compiled with namespaces from its elements (xml_libxslt1_stylesheet_new_empty).- Parameters:
style_dom- The document.settings- The settings, null for the defaults.- Returns:
- The stylesheet.
-
stylesheetFree
Free a stylesheet (xml_libxslt1_stylesheet_free), nothing to do in java.- Parameters:
style- The stylesheet.
-
compile
Compile a stylesheet (libxslt xsltParseStylesheetDoc, xml_libxslt1_compile). The stylesheet takes the document and modifies it (whitespace is stripped etc).- Parameters:
doc- The stylesheet document.settings- The settings, null for the defaults.- Returns:
- The stylesheet, null after reporting errors.
-
stylesheetDescribe
A description of the compiled stylesheet (output settings, templates, keys, global variables, attribute sets, ...), for testing (xml_libxslt1_stylesheet_describe).- Parameters:
style- The stylesheet.- Returns:
- The description.
-