Question: In the sample program UseXMLFilters.java (located in
xml-xalan/java/samples/UseXMLFilters) it appears that 3 XMLFilters
(filter1, filter2, and filter3 in diagram) are being chained together
into a pipeline, a Serializer is plugged into filter3 as a
ContentHandler, and an XMLReader is plugged into filter1 as a parent.
And then, the input XML document is being feed into the *last*
filter in the pipeline:
XMLReader foo1.xsl foo2.xsl foo3.xsl foo.xml
| ^ | | | |
| | | | | |
| | v v v |
| | xml +----------+----------+-----------+ xml |
| +----<---| | | |<-------+
| | filter1 | filter2 | filter3 |
+----->------| | | |------> Serializer
sax evts +----------+----------+-----------+
So the app program calls filter3.parse("foo.xml"); filter3 turns around
and calls filter2.parse("foo.xml"); filter2 turns around and calls
filter1.parse("foo.xml"); filter1 finally hands off the xml doc to
an XMLReader, the reader parses the doc and produces SAX parser
events. The parser events are input to filter1; transformed; output
of transform is sent to filter2; transformed; output to filter3
transformed and then output to Serializer.
(If I am correct in this analysis) then the question: why have the
Xml input doc be 'forwarded' from the end of the pipe to the beginning,
to be read? Why not design the pipeline such as:
foo1.xsl foo2.xsl foo3.xsl
foo.xml | | |
| | | |
| v v v
| +----------+----------+-----------+
v | | | |
XMLReader---->| filter1 | filter2 | filter3 |------> Serializer
| | | |
+----------+----------+-----------+
Thanks for any insights/corrections to this,
-Todd
=======================================================================
G. Todd Miller Sun Microsystems Computer Company
Software Systems Engineer 2 Network Drive, MS UBUR02-201
GE&IS XML Tech Center Burlington, MA 01803-0903
781 442-0176
781 442-1437 (fax)
[EMAIL PROTECTED]
XMLFilter chaining question...
G. Todd Miller - XML Tech Ctr - Development Fri, 22 Jun 2001 10:19:30 -0700
- Re: XMLFilter chaining questio... G. Todd Miller - XML Tech Ctr - Development
- Re: XMLFilter chaining qu... Gary L Peskin
- Setting System Properties... Paul O'Neill
- Re: XMLFilter chaining qu... Scott_Boag
