A method for processing an electronic document may include performing a programmatic analysis to determine all required portions of an input document to produce an output document. The method may also include generating an executable transformer to produce the output document from the input document. The method may further include producing the output document by transforming any streamable parts of the input document directly to corresponding parts of the output document without extraneous intermediate buffering.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A method for processing an electronic document, comprising: performing, by a processor, a programmatic analysis to determine all required portions of an input document to produce an output document; generating, by the processor, an executable transformer to produce the output document from the input document; and producing, by the processor, the output document by transforming any streamable parts of the input document directly to corresponding parts of the output document without extraneous intermediate buffering.
2. The method of claim 1 , wherein generating the executable transformer comprises: generating a parser to parse the input document; and generating an optimized program code to transform the input document to produce the output document.
3. The method of claim 1 , further comprising: building-up an optimized document model from any non-streamable parts of the input document; and processing the built-up optimized document model in the executable transformer to complete the output document.
4. The method of claim 1 , wherein performing the programmatic analysis comprises performing a whole-program data usage analysis.
5. The method of claim 1 , wherein performing the programmatic analysis comprises: analyzing accesses by a stylesheet to the input document to generate the executable transformer; and rewriting expressions of the stylesheet that address any required portions of the input document.
6. The method of claim 1 , further comprising determining which nodes and contexts of the input document are streamable.
7. The method of claim 6 , further comprising determining that the node is streamable if the node can produce an output to which the node contributes as the node's input data is parsed.
8. The method of claim 6 , wherein determining which nodes and contexts of an input document are streamable comprises determining which portions of the optimized output program rely upon references of the input document that are entirely local to a particular subtree of the input document.
9. The method of claim 6 , wherein determining which nodes and contexts of an input document are streamable comprises: initializing all data references as being streamable; matching a root path of the input document into a template; setting the root path of the input document as a current context; determining if the current context is streamable based on a data reference defining the current context; streaming the current context during parsing of the input document in response to the current context being streamable; and buffering the current context in response to the current context being non-streamable.
10. The method of claim 9 , wherein determining if the current context is streamability comprises: determining if an output construct requires output generation in a non-document order; marking a data reference as non-streamable in response to the output construct requiring output generation in a non-document order and buffering a re-ordered form of the input document; marking a first input data reference required to produce the output construct as streamable in response to the output construct not requiring generation in a non-document order; and determining if previous input data reference in the current context only references information in an opening element SAX-like event, wherein the current data reference is streamable in response to the previous input data referencing information in the opening element SAX-like event.
11. The method of claim 1 , further comprising erasing from a memory any parts of the input document which will never again be referenced by the executable transform as determined from a streamability analysis.
12. A system for processing a document, comprising: a programmatic analyzer operable on a processor to determine all required portions of an input document to produce an output document; a streamability analysis module to determine which nodes and contexts of an input document are streamable to produce the output document; and a buffer to build-up an optimized document model from any non-streamable parts of the input document.
13. The system of claim 12 , further comprising an executable transformer generable to produce the output document transformed from the input document.
14. The system of claim 13 , wherein the executable transformer comprises: a parser to parse the input document; an optimized program code to transform the input document to produce the output document.
15. The system of claim 12 , wherein the streamability analysis module comprises: means for initializing all data references as being streamable; means for matching a root path of the input document into a template; means for setting the root path of the input document as a current context; means for determining if the current context is streamable by determining a streamability of data references inside the current context; means for streaming the current context during parsing of the input document in response to the current context being streamable; and a buffer to buffer the current context in response to the current context being non-streamable.
16. A computer program product to process an electronic document, the computer program product comprising: a computer usable storage medium having computer usable program code embodied therein, the computer usable storage medium comprising: computer usable program code configured to perform a programmatic analysis to determine all required portions of an input document to produce an output document; computer usable program code configured to generate an executable transformer to produce the output document from the input document; and computer usable program code configured to produce the output document by transforming any streamable parts of the input document directly to corresponding parts of the output document without extraneous intermediate buffering.
17. The computer program product of claim 16 , wherein the computer usable medium further comprises: computer usable program code configured to generate a parser to parse the input document; and computer usable program code configured to generate an optimized program code to transform the input document to produce the output document.
18. The computer program product of claim 16 , wherein the computer usable medium further comprises computer usable program code configured to buffer any non-streamable nodes and contexts of the input document.
19. The computer program product of claim 16 , wherein the computer usable medium further comprises: computer usable program code configured to build-up an optimized document model from any non-streamable parts of the input document; and computer usable program code configured to process the built-up optimized document model in the executable transformer to complete the output document.
20. The computer program product of claim 16 , wherein the computer usable medium further comprises: computer usable program code configured to initialize all data references as being streamable; computer usable program code configured to match a root path of the input document into a template; computer usable program code configured to set the root path of the input document as a current context; computer usable program code configured to determine if the current context is streamable by determining streamability of data references inside the current context; computer usable program code configured to stream the current context during parsing of the input document in response to the current context being streamable; and computer usable program code configured to buffer the current context in response to the current context being non-streamable.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
November 1, 2007
February 21, 2012
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.