Class RegularSequenceChecker

    • Constructor Detail

      • RegularSequenceChecker

        public RegularSequenceChecker​(Receiver nextReceiver)
        Create a RegularSequenceChecker and allocate a unique Id.
        Parameters:
        nextReceiver - the underlying receiver to which the events will be sent (without change)
    • Method Detail

      • append

        public void append​(Item item,
                           Location locationId,
                           int copyNamespaces)
                    throws XPathException
        Append an arbitrary item (node or atomic value) to the output. In a regular sequence, append events occur only at the top level, that is, when the document / element stack is empty.
        Specified by:
        append in interface Receiver
        Overrides:
        append in class ProxyReceiver
        Parameters:
        item - the item to be appended
        locationId - the location of the calling instruction, for diagnostics
        copyNamespaces - if the item is an element node, this indicates whether its namespaces need to be copied. Values are ReceiverOptions.ALL_NAMESPACES, ReceiverOptions.LOCAL_NAMESPACES; the default (0) means no namespaces
        Throws:
        XPathException
      • attribute

        public void attribute​(NodeName nameCode,
                              SimpleType typeCode,
                              CharSequence value,
                              Location locationId,
                              int properties)
                       throws XPathException
        Notify an attribute. An attribute is either free-standing attribute, or a parented attribute. A free-standing attribute is one that occurs when the startElement / startDocument stack is empty; a parented attribute occurs between a startElement event and a startContent event.

        All attributes must satisfy the following constraints:

        1. The namespace prefix and URI must either both be present (non-zero-length) or both absent
        2. The prefix "xml" and the URI "http://www.w3.org/XML/1998/namespace" are allowed only in combination.
        3. The namespace URI "http://www.w3.org/2000/xmlns/" is not allowed.
        4. The namespace prefix "xmlns" is not allowed.
        5. The local name "xmlns" is not allowed in the absence of a namespace prefix and URI.

        For a parented attribute, the following additional constraints apply to the set of attributes between a startElement event and the next startContent event:

        1. No two attributes may have the same (local-name, namespace URI) combination.
        2. No namespace prefix may be used in conjunction with more than one namespace URI.
        3. Every (namespace prefix, namespace URI) combination must correspond to an in-scope namespace: that is, unless the (prefix, URI) pair is ("", "") or ("xml", "http://www.w3.org/XML/1998/namespace"), it must be the subject of a namespace(NamespaceBindingSet, int) event applicable to this element or to some parent element, that has not been cancelled by a namespace undeclaration on an inner element. If the namespace event appears on the same element as the attribute event then they may arrive in either order.

        These constraints are not currently enforced by this class.

        Specified by:
        attribute in interface Receiver
        Overrides:
        attribute in class ProxyReceiver
        Parameters:
        nameCode - The name of the attribute
        typeCode - The type of the attribute
        locationId - The location of the attribute
        properties - Bit significant value. The following bits are defined:
        DISABLE_ESCAPING
        Disable escaping for this attribute
        NO_SPECIAL_CHARACTERS
        Attribute value contains no special characters
        value - the string value of the attribute
        Throws:
        XPathException - if an error occurs
      • characters

        public void characters​(CharSequence chars,
                               Location locationId,
                               int properties)
                        throws XPathException
        Character data (corresponding to a text node). For character data within content (that is, events occurring when the startDocument / startElement stack is non-empty), character data events will never be consecutive and will never be zero-length.
        Specified by:
        characters in interface Receiver
        Overrides:
        characters in class ProxyReceiver
        Parameters:
        chars - The characters
        locationId - provides information such as line number and system ID.
        properties - Bit significant value. The following bits are defined:
        DISABLE_ESCAPING
        Disable escaping for this text node
        USE_CDATA
        Output as a CDATA section
        Throws:
        XPathException - if an error occurs
      • comment

        public void comment​(CharSequence chars,
                            Location locationId,
                            int properties)
                     throws XPathException
        Output a comment
        Specified by:
        comment in interface Receiver
        Overrides:
        comment in class ProxyReceiver
        Parameters:
        chars - The content of the comment
        locationId - provides information such as line number and system ID.
        properties - Additional information about the comment.
        Throws:
        XPathException - if an error occurs
      • namespace

        public void namespace​(NamespaceBindingSet namespaceBindings,
                              int properties)
                       throws XPathException
        Notify a namespace. Namespaces are notified after the startElement event, and before any children for the element. The namespaces that are reported are only required to include those that are different from the parent element; however, duplicates may be reported. A namespace must not conflict with any namespaces already used for element or attribute names.
        Specified by:
        namespace in interface Receiver
        Overrides:
        namespace in class ProxyReceiver
        Parameters:
        namespaceBindings - the namespace (prefix, uri) pair to be notified
        properties - any special properties to be passed on this call
        Throws:
        XPathException - if an error occurs
      • processingInstruction

        public void processingInstruction​(String target,
                                          CharSequence data,
                                          Location locationId,
                                          int properties)
                                   throws XPathException
        Processing Instruction
        Specified by:
        processingInstruction in interface Receiver
        Overrides:
        processingInstruction in class ProxyReceiver
        Parameters:
        target - The PI name. This must be a legal name (it will not be checked).
        data - The data portion of the processing instruction
        locationId - provides information such as line number and system ID.
        properties - Additional information about the PI.
        Throws:
        XPathException - if an error occurs
      • startContent

        public void startContent()
                          throws XPathException
        Notify the start of the content, that is, the completion of all attributes and namespaces. Note that the initial receiver of output from XSLT instructions will not receive this event, it has to detect it itself. Note that this event is reported for every element even if it has no attributes, no namespaces, and no content.
        Specified by:
        startContent in interface Receiver
        Overrides:
        startContent in class ProxyReceiver
        Throws:
        XPathException - if an error occurs
      • startElement

        public void startElement​(NodeName nameCode,
                                 SchemaType typeCode,
                                 Location location,
                                 int properties)
                          throws XPathException
        Notify the start of an element
        Specified by:
        startElement in interface Receiver
        Overrides:
        startElement in class ProxyReceiver
        Parameters:
        nameCode - integer code identifying the name of the element within the name pool.
        typeCode - integer code identifying the element's type within the name pool.
        location - provides information such as line number and system ID.
        properties - properties of the element node
        Throws:
        XPathException - if an error occurs