Class XsltPackage


  • public class XsltPackage
    extends java.lang.Object
    An XsltPackage object represents the result of compiling an XSLT 3.0 package, as represented by an XML document containing an xsl:package element.
    Since:
    9.6
    • Method Detail

      • getProcessor

        public Processor getProcessor()
        Get the processor under which this package was created
        Returns:
        the corresponding Processor
      • getName

        public java.lang.String getName()
        Get the name of the package (the URI appearing as the value of xsl:package/@name)
        Returns:
        the package name
      • getVersion

        public java.lang.String getVersion()
        Get the version number of the package (the value of the attribute xsl:package/@package-version. Note that this may have had trailing zeroes truncated.
        Returns:
        the package version number(s)+suffix?
      • getWhitespaceStrippingPolicy

        public WhitespaceStrippingPolicy getWhitespaceStrippingPolicy()
        Get the whitespace stripping policy defined by this stylesheet package, that is, the policy defined by the xsl:strip-space and xsl:preserve-space elements in the source XSLT code of the package.
        Returns:
        a newly constructed WhitespaceStrippingPolicy based on the declarations in this stylesheet package. This policy can be used as input to a DocumentBuilder.
      • link

        public XsltExecutable link()
                            throws SaxonApiException
        Link this package with the packages it uses, to form an executable stylesheet. This process fixes up any cross-package references to files, templates, and other components, and checks to ensure that all such references are consistent.
        Returns:
        the resulting XsltExecutable
        Throws:
        SaxonApiException - if any error is found during the linking process, for example if the constituent packages containing duplicate component names, or if abstract components are not resolved.
      • save

        public void save​(java.io.File file)
                  throws SaxonApiException
        Save this compiled package to filestore.
        Parameters:
        file - the file to which the compiled package should be saved
        Throws:
        SaxonApiException - if the compiled package cannot be saved to the specified location, or if the package was compiled with just-in-time compilation enabled
        Since:
        9.7
      • save

        @Deprecated
        public void save​(java.io.File file,
                         java.lang.String target)
                  throws SaxonApiException
        Deprecated.
        since 9.9.1.3. Use XsltCompiler.setTargetEdition() to define the target environment.
        Save this compiled package to filestore for a particular target environment
        Parameters:
        file - the file to which the compiled package should be saved
        target - the target environment (for example "EE" or "JS")
        Throws:
        SaxonApiException - if the compiled package cannot be saved to the specified location, or if the package was compiled with just-in-time compilation enabled.
        Since:
        9.7.0.5
      • getUnderlyingPreparedPackage

        public StylesheetPackage getUnderlyingPreparedPackage()
        Escape-hatch interface to the underlying implementation class.
        Returns:
        the underlying StylesheetPackage. The interface to StylesheetPackage is not a stable part of the s9api API definition.