Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Latest commit

 

History

History
15 lines (12 loc) · 617 Bytes

README.md

File metadata and controls

15 lines (12 loc) · 617 Bytes

SaXPath

Simple XPath evaluator which runs against a SAX stream.

Supported XPath construct as of writing are:

  • '/'-axis (child)
  • '//'-axis (self-or-descendant)
  • node name tests
  • predicate test (@<attribute_name> = "")

Inner workings

A state machine is built which the SAX-nodes are tested against. If a node matches, the state machine progresses.

For self-or-descendant-nodes, the state machine is forked and earch fork (including the parent) is tested against the SAX-nodes. This ensures all nodes are matched. See test/saxpath.js and test/inception.xml for an example.