Class XSLDocument

  • All Implemented Interfaces:
    NodeInfo, javax.xml.transform.dom.DOMLocator, javax.xml.transform.Source, javax.xml.transform.SourceLocator, org.w3c.dom.Element, org.w3c.dom.NamedNodeMap, org.w3c.dom.Node, org.xml.sax.Locator

    public class XSLDocument
    extends XSLGeneralOutput
    An xsl:document (formerly saxon:output) element in the stylesheet.
    The xsl:document element takes an attribute href="filename". The filename will often contain parameters, e.g. {position()} to ensure that a different file is produced for each element instance.
    There is a further attribute method=xml|html|text which determines the format of the output file (default XML). Alternatively the xsl:document element may take a next-in-chain attribute in which case output is directed to another stylesheet. Any unrecognized namespaced attributes are interepreted as attribute value templates, and their values are added to the output properties, for use by a user-defined Emitter.
    • Constructor Detail

      • XSLDocument

        public XSLDocument()
    • Method Detail

      • isInstruction

        public boolean isInstruction()
        Determine whether this node is an instruction.
        Overrides:
        isInstruction in class StyleElement
        Returns:
        true - it is an instruction
      • mayContainTemplateBody

        public boolean mayContainTemplateBody()
        Determine whether this type of element is allowed to contain a template-body
        Overrides:
        mayContainTemplateBody in class StyleElement
        Returns:
        true: yes, it may contain a template-body
      • prepareAttributes

        public void prepareAttributes()
                               throws javax.xml.transform.TransformerConfigurationException
        Description copied from class: StyleElement
        Set the attribute list for the element. This is called to process the attributes (note the distinction from processAttributes in the superclass). Must be supplied in a subclass
        Overrides:
        prepareAttributes in class XSLGeneralOutput
        Throws:
        javax.xml.transform.TransformerConfigurationException
      • validate

        public void validate()
                      throws javax.xml.transform.TransformerConfigurationException
        Description copied from class: StyleElement
        Check that the element is valid. This is called once for each element, after the entire tree has been built. As well as validation, it can perform first-time initialisation. The default implementation does nothing; it is normally overriden in subclasses.
        Overrides:
        validate in class StyleElement
        Throws:
        javax.xml.transform.TransformerConfigurationException
      • process

        public void process​(Context context)
                     throws javax.xml.transform.TransformerException
        Description copied from class: StyleElement
        Process: called to do the real work of this stylesheet element. This method must be implemented in each subclass.
        Specified by:
        process in class StyleElement
        Parameters:
        context - The context in the source XML document, giving access to the current node, the current variables, etc.
        Throws:
        javax.xml.transform.TransformerException