@continuit/xmlscanner@1.0.0Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
A fast XML scanner/parser with no dependencies. Given an XML string, the xml scanner will parse the XML and invoke the defined events on the specified paths.
Add an attribute event to the trie structure.
Add an element to the trie structure.
Event triggered when an attribute value is encountered.
Event triggered when CDATA content is encountered.
Event triggered when a comment is encountered.
Event triggered when a processing instruction is encountered.
Event triggered when an XML tag is closed.
Event triggered when an XML tag is opened.
Event triggered when text content is encountered.
Decodes XML entities in a string. If an invalid entity is encountered it is left unchanged in the result
Analyzes the given XML string and returns a sorted array of unique paths and elements found within the XML. The paths include tags, attributes, text content, CDATA sections, processing instructions, and comments.
Event triggered when an XML declaration is encountered. The XML declaration can only appear as the first token in the XML document.
Event triggered when a DOCTYPE declaration is encountered. The DOCTYPE declaration can only appear before the root element in the XML document.
Error messages for XML parsing errors.
- ATTRIBUTE_VALUE_NOT_CLOSED
- CDATA_NOT_CLOSED
- COMMENT_NOT_CLOSED
- DOCTYPE_NOT_SUPPORTED
- INVALID_ATTRIBUTE_NAME
- INVALID_ELEMENT_NAME
- MISMATCHED_TAG
- MULTIPLE_DOCTYPE_FOUND
- MULTIPLE_ROOT_ELEMENTS
- NO_ENDTAG_FOUND
- NO_ROOT_ELEMENT_FOUND
- PROCESSING_INSTRUCTION_NOT_CLOSED
- UNEXPECTED_TOKEN
- XML_DECLARATION_MUST_BE_FIRST_TOKEN
Represents a collection of event handlers for XML parsing.
Error codes as a type for XML parsing errors.
Execute the XML scanner. The XML scanner will parse the XML string and invoke the defined by xmlEvents t rie.
Event triggered when an unknown attribute is encountered.