Class Xslt

java.lang.Object
org.libxmq.imp.xml.libxslt1.Xslt

public final class Xslt extends Object
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 Details

    • defaultLoader

      public static XmlDocument defaultLoader(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.
      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

      public static Stylesheet stylesheetNewEmpty(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).
      Parameters:
      style_dom - The document.
      settings - The settings, null for the defaults.
      Returns:
      The stylesheet.
    • stylesheetFree

      public static void stylesheetFree(Stylesheet style)
      Free a stylesheet (xml_libxslt1_stylesheet_free), nothing to do in java.
      Parameters:
      style - The stylesheet.
    • compile

      public static Stylesheet compile(XmlDocument doc, Settings settings)
      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

      public static String stylesheetDescribe(Stylesheet style)
      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.