Document-searching using a compiling device for generating a two-state
input automaton for enabling a state transition by storing an input query
expression, performing parsing, and reading at least two states from
different types of nodes in an element identifier, and a storage device
for storing the two-state input automaton. Also included is an
automaton-evaluating device for enabling three state transitions by
reading out a two-state input automaton from the storage device and
storing the automaton, while reading in a document and identifying the
input two states.