S
stephen.nil
http://code.google.com/p/spxml/
http://spxml.googlecode.com/files/spxml-0.1.src.tar.gz
Simple Plain Xml Parser (spxml) is a simple and plain stream-oriented
XML parser that supports pull-model and DOM-model XML parsing. As the
user passes it chunks of an XML document, it identifies elements,
character data, or other entities and return the appropriate event.
Chunks can range from one byte to the whole XML document and can safely
be read from pipes. Resulting DOM trees can be read, modified, and
saved.
Using state pattern make it simple to implement the xml parser.
State pattern has three participants:
* Context ( SP_XmlPullParser )
o defines the interface of interest to clients
o maintains an instance of a ConcreteState subclass that
defines the current state.
* State ( SP_XmlReader )
o defines an interface for encapsulating the behavior
associated with a particular state of the Context.
* Concrete State ( SP_XmlStartTagReader, SP_XmlEndTagReader, etc )
o each subclass implements a behavior associated with a state
of Context
http://spxml.googlecode.com/files/spxml-0.1.src.tar.gz
Simple Plain Xml Parser (spxml) is a simple and plain stream-oriented
XML parser that supports pull-model and DOM-model XML parsing. As the
user passes it chunks of an XML document, it identifies elements,
character data, or other entities and return the appropriate event.
Chunks can range from one byte to the whole XML document and can safely
be read from pipes. Resulting DOM trees can be read, modified, and
saved.
Using state pattern make it simple to implement the xml parser.
State pattern has three participants:
* Context ( SP_XmlPullParser )
o defines the interface of interest to clients
o maintains an instance of a ConcreteState subclass that
defines the current state.
* State ( SP_XmlReader )
o defines an interface for encapsulating the behavior
associated with a particular state of the Context.
* Concrete State ( SP_XmlStartTagReader, SP_XmlEndTagReader, etc )
o each subclass implements a behavior associated with a state
of Context