Next | ||
10.6.1 XML Processing Architecture
RVML is processed by KineticFusion using an XML parser technology called SAX (Simple API for XML). In a standard SAX architecture, a system XMLParser reads in the XML document and, as it reads the document, generates SAX events that are handled by a ContentHandler object supplied by the application. When processing RVML, the following SAX events need to be handled in an RVML-specific way:
- Start Element event
- This event is generated when an XML start tag is encountered on input. The information in the event provides the namespace, element name and defined attributes. There is always just one namespace and element name but there can be zero or more attributes associate with a start tag.
- End Element event
- This event is generated which an XML end tag is encountered on input.
- Characters Event
- This event is generated when characters are detected between tags, including all whitespace characters.
For example, the following illustrates a tiny RVML document and the SAX events that are received by the ContentHandler from the SAXParser:
<Movie version='7' width='600' height='550' xmlns='http://www.kineticfusion.org/RVML/1.0'> <Timeline frameCount='1'> <EmptyFrame/> </Timeline> </Movie>
Generates the following SAX events:
startDocument startElement(http://www.kineticfusion.org/RVML/1.0, Movie, [width, height]) characters(whitespace) startElement(http://www.kineticfusion.org/RVML/1.0, Timeline, []) characters(whitespace) startElement(http://www.kineticfusion.org/RVML/1.0, EmptyFrame, []) endElement(http://www.kineticfusion.org/RVML/1.0, EmptyFrame) characters(whitespace) endElement(http://www.kineticfusion.org/RVML/1.0, Timeline) characters(whitespace) endElement(http://www.kineticfusion.org/RVML/1.0, Movie) endDocument
The KineticFusion ContentHandler is a special KineticFusion Java class that delegates all RVML processing to a hierarchy of specialised element processors.
Next |
Copyright 2003-2005 Kinesis Software. All rights reserved.