Class XIncludeExtension

All Implemented Interfaces:

public class XIncludeExtension extends Object implements ReportFactoryExtension
A ReportFactoryExtension that adds support for XML Inclusions (XInclude). Support for this is based on the working note describing version 1.1. The following changes are made to that note:
  1. The "parse" attribute defaults to the content-type of the resource being loaded, with "application/xml" being used as a fallback.
  2. The "bfo:xslt" attribute can be set to apply an XSLT stylesheet as the final stage of processing, after any xpointer is evaluated. It will be applied to each Node
  3. Content of type "text/html" is parsed as if it were XML. Other types are inserted into the document's page list at that point in the document, if supported.
  4. Fragments on URLs may be used as a lower-priority alternative to setting "fragid" or "xpointer"
  • Constructor Details

    • XIncludeExtension

      public XIncludeExtension()
  • Method Details

    • setAllowFragments

      public void setAllowFragments(boolean fragments)
      As specified the href passed into xi:include does not allow fragments to be specified. By default this implementation does allow them, as a lower-priority alternative to the \"fragid\" and \"xpointer\" attributes. Set this value to false to disallow them, as required by the specification.
    • setExceptionsAreFatal

      public void setExceptionsAreFatal(boolean fatal)
      Set whether exceptions encountered during XInclude processing are fatal, or just lead to the document being processed without the included file The default is true
      fatal - if true, exceptions while processing XInclude are fatal.
    • isExceptionsAreFatal

      public boolean isExceptionsAreFatal()
      Return the value set in setExceptionsAreFatal(boolean)
    • isAllowFragments

      public boolean isAllowFragments()
      Return the value set in setAllowFragments(boolean)
    • configure

      public void configure(Json json)
      Description copied from interface: ReportFactoryExtension
      Configure the extension. This method will be called by the web-service immediately after the extension is added, to pass in any parameters set by the user. The default implementation does nothing
      Specified by:
      configure in interface ReportFactoryExtension