[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Another scheme for document factories...
This works off of the assumption that the host application's document factory has two modes, a light weight mode where it just builds nodes in memory, and a heavy weight mode where it has been turned the nodes into a display object or output to a file. This eliminates the need for a special chaining DF. James Clark has an interesting API for a document factory in XT (the result object). It supports a DF can write to a file without constructing a tree in memory. He achieves node output by recursing after writing the start tag. This allows only one copy of the document tree to be in memory when processing large documents. To allow chaining I've extended this scheme by breaking the document node into two pieces, the pointers describing the tree structure and the actual data in the node. My default DF supports rapid stylesheet chaining by implementing a fastcopy method. This method builds a new tree structure for the node and just references the original node contents. The following syntax allows specifying the DF at each stage of processing.... <?xml version="1.0" encoding="ISO-8859-1"?> // give the default DF a new set of bindings <?xdf bind="objectmap"?> // load the stylesheet into memory // run the last application, there is none so load the rest of the input document in light weight mode // change the application to xsl <?xsl xsl="koala1.xsl"?> // reset the DF to default bindings <?xdf xdf=""?> // load the stylesheet into memory // run the last application, xsl, this will cause a new tree to be built in light weight mode // change the application to xsl <?xsl xsl="koala2.xsl"?> // set a different DF and give it a set of bindings <?xdf xdf="myfactory3" bind="objectmap3"?> // run the last application, xsl // since there are no more PIs this will cause a new tree to be built in heavy weight mode <first tag of document> <?xml version="1.0" encoding="ISO-8859-1"?> // run the last application, there is none so load the rest of the input document in light weight mode <?xsl xsl="koala1.xsl"?> // run the last application, xsl, , this will cause a new tree to be built in light weight mode <?xsl xsl="koala2.xsl"?> // set a different DF and give it a set of bindings <?xdf xdf="myfactory3" bind="objectmap3"?> // run the last application, xsl // since there are no more PIs this will cause a new tree to be built in heavy weight mode <first tag of document> <?xml version="1.0" encoding="ISO-8859-1"?> // run the last application, there is none so load the rest of the input document in light weight mode <?xsl xsl="koala1.xsl"?> // run the last application, xsl // since there are no more PIs this will cause a new tree to be built in heavy weight mode <first tag of document> <?xml version="1.0" encoding="ISO-8859-1"?> // set a different DF and give it a set of bindings <?xdf xdf="myfactory3" bind="objectmap3"?> // run the last application, the default application // since there are no more PIs this will cause a tree to be built in heavy weight mode <first tag of document> <?xml version="1.0" encoding="ISO-8859-1"?> // run the last application, the default application // since there are no more PIs this will cause a tree to be built in heavy weight mode <first tag of document> Jon Smirl jonsm@a... xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|