Class RegularSequenceChecker

    • Constructor Detail

      • RegularSequenceChecker

        public RegularSequenceChecker​(Receiver nextReceiver,
                                      boolean fullChecking)
        Create a RegularSequenceChecker and allocate a unique Id.
        Parameters:
        nextReceiver - the underlying receiver to which the events will be sent (without change)
        fullChecking - requests full validation of the content passed across the interface. If false, the only checking is that the sequence of events is correct. If true, more thorough validation is carried out (though this does not necessarily mean that every violation is detected).
    • 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 ReceiverOption.ALL_NAMESPACES; the default (0) means
        Throws:
        XPathException - if an error occurs
      • characters

        public void characters​(java.lang.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​(java.lang.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
      • processingInstruction

        public void processingInstruction​(java.lang.String target,
                                          java.lang.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
      • startElement

        public void startElement​(NodeName elemName,
                                 SchemaType type,
                                 AttributeMap attributes,
                                 NamespaceMap namespaces,
                                 Location location,
                                 int properties)
                          throws XPathException
        Notify the start of an element.

        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.

        The following additional constraints apply to the set of attributes as a whole:

        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 present in the in-scope namespaces.

        These constraints are not all enforced by this class.

        Specified by:
        startElement in interface Receiver
        Overrides:
        startElement in class ProxyReceiver
        Parameters:
        elemName - the name of the element. If the name is in a namespace (non-empty namespace URI) then the Outputter.namespace(String, String, int) event must include a binding for the relevant prefix (or absence of a prefix) to the relevant URI.
        type - the type annotation of the element.
        attributes - the attributes of the element
        namespaces - the in-scope namespaces of the element
        location - provides information such as line number and system ID.
        properties - properties of the element node
        Throws:
        XPathException - if an error occurs