Class ElementCreator

    • Field Detail

      • bequeathNamespacesToChildren

        boolean bequeathNamespacesToChildren
        The bequeathNamespacesToChildren flag indicates that the namespace nodes on the element created by this instruction are to be inherited (copied) by the children of this element. That is, if this flag is false, the child elements must carry a namespace undeclaration for all the namespaces on the parent, unless they are redeclared in some way. This flag is set in XSLT based on the value of the [xsl:]inherit-namespaces attribute on the element construction instruction, and in XQuery based on the value of "copy namespaces inherit | no-inherit" in the query prolog.
      • inheritNamespacesFromParent

        boolean inheritNamespacesFromParent
        The inheritNamespacesFromParent flag indicates that this element should inherit the namespaces of its parent element in the result tree. That is, if this flag is false, this element must carry a namespace undeclaration for all the namespaces on its parent, unless they are redeclared in some way. In XSLT this flag is always true, but in XQuery it is set to false for a child element constructed using <parent><child/></parent> as distinct from <parent>{<child/>}parent -- in the former case, the child element is not copied and therefore namespace inheritance does not apply.
    • Constructor Detail

      • ElementCreator

        public ElementCreator()
        Construct an ElementCreator. Exists for the benefit of subclasses.
    • Method Detail

      • getItemType

        public ItemType getItemType()
        Get the item type of the value returned by this instruction
        Overrides:
        getItemType in class Instruction
        Returns:
        the item type
      • getCardinality

        public int getCardinality()
        Description copied from class: Expression
        Determine the static cardinality of the expression. This establishes how many items there will be in the result of the expression, at compile time (i.e., without actually evaluating the result.
        Overrides:
        getCardinality in class ParentNodeConstructor
        Returns:
        one of the values Cardinality.ONE_OR_MORE, Cardinality.ZERO_OR_MORE, Cardinality.EXACTLY_ONE, Cardinality.ZERO_OR_ONE, Cardinality.EMPTY. This default implementation returns ZERO_OR_MORE (which effectively gives no information).
      • setBequeathNamespacesToChildren

        public void setBequeathNamespacesToChildren​(boolean inherit)
        Say whether this element causes its children to inherit namespaces
        Parameters:
        inherit - true if namespaces are to be inherited by the children
      • isBequeathNamespacesToChildren

        public boolean isBequeathNamespacesToChildren()
        Ask whether the inherit namespaces flag is set
        Returns:
        true if namespaces constructed on this parent element are to be inherited by its children
      • setInheritNamespacesFromParent

        public void setInheritNamespacesFromParent​(boolean inherit)
        Say whether this element causes inherits namespaces from its parent. True except in XQuery where one direct element constructor forms the immediate content of another (see W3C bug 22334)
        Parameters:
        inherit - true if namespaces are to be inherited from the parent
      • isInheritNamespacesFromParent

        public boolean isInheritNamespacesFromParent()
        Ask whether this element inherits namespaces from its parent. True except in XQuery where one direct element constructor forms the immediate content of another (see W3C bug 22334)
        Returns:
        true if this child element inherits namespaces from its parent element
      • computeSpecialProperties

        protected int computeSpecialProperties()
        Get the static properties of this expression (other than its type). The result is bit-signficant. These properties are used for optimizations. In general, if property bit is set, it is true, but if it is unset, the value is unknown.
        Overrides:
        computeSpecialProperties in class Instruction
        Returns:
        a set of flags indicating static properties of this expression
      • suppressValidation

        public void suppressValidation​(int parentValidationMode)
        Suppress validation on contained element constructors, on the grounds that the parent element is already performing validation. The default implementation does nothing.
        Overrides:
        suppressValidation in class Expression
        Parameters:
        parentValidationMode - the kind of validation being performed on the parent expression
      • outputNamespaceNodes

        public abstract void outputNamespaceNodes​(Outputter receiver,
                                                  NodeName nodeName,
                                                  ElementCreator.ElementCreationDetails details)
                                           throws XPathException
        Callback to output namespace bindings for the new element. This method is responsible for ensuring that a namespace binding is always generated for the namespace of the element name itself.
        Parameters:
        receiver - the Outputter where the namespace bindings are to be written
        nodeName - the name of the element being created
        details - details supplied to the process() call
        Throws:
        XPathException - if a dynamic error occurs
      • getInheritanceFlags

        String getInheritanceFlags()
      • setInheritanceFlags

        public void setInheritanceFlags​(String flags)
      • getStreamerName

        public String getStreamerName()
        Get the (partial) name of a class that supports streaming of this kind of expression
        Overrides:
        getStreamerName in class Expression
        Returns:
        the partial name of a class that can be instantiated to provide streaming support in Saxon-EE, or null if there is no such class