System and method for transformation of XML documents using stylesheets
AssigneeIntel Corporation
InventorKevin J. Jones
Life of this patent
Estimating the term…
Abstract
A method and apparatus are provided for processing one or more XML documents where the processing includes a plurality of stylesheets using an abstract machine. The method includes the steps of reading a stylesheet of the plurality of stylesheets, compiling the stylesheet into a set of abstract machine instructions specialized for stylesheet processing and executing the instructions on the abstract machine.
Claims20
A computer-implemented method for processing one or more XML documents, where the processing includes a plurality of stylesheets using an abstract machine, the method comprising:
- reading a stylesheet of the plurality of stylesheets;
- parsing at least some Xpath expressions within the plurality of stylesheets into a respective tree of nodes;
- annotating the respective tree of nodes of the Xpath expressions with a data type of the Xpath expression;
- compiling the respective annotated tree of nodes of the Xpath expressions into a set of abstract machine instructions specialized for stylesheet processing, wherein the set of abstract machine instructions comprises a plurality of blocks of abstract machine instructions for the compiled stylesheet and includes a backtracking abstract machine instruction for each block of the plurality of blocks;
- executing the instructions on an abstract machine to produce an output document, wherein the abstract machine uses a plurality of types of contiguous memory storage to match requirements of the stylesheet processing and wherein the plurality of types of contiguous memory storage includes a code stack, a heap stack and a transform allocator;
- resetting the code stack and the heap stack upon processing completing of each block of the plurality of blocks;
- and
- calling a block of the plurality of blocks via a pattern match for imports which calls a template that can match with a lower import precedence than a current template,
- wherein the executing the abstract machine instruction set in the abstract machine further comprises processing a representation of the one or more XML documents.
An apparatus for processing one or more XML documents where the processing includes a plurality of stylesheets using an abstract machine, the apparatus comprising:
- a processor;
- a memory coupled to the processor;
- means for reading a stylesheet of the plurality of stylesheets;
- means for parsing at least some Xpath expressions within the plurality of stylesheets into a respective tree of nodes;
- means for annotating the respective tree of nodes of the Xpath expressions with a data type of the Xpath expression;
- means for compiling the respective annotated tree of nodes of the Xpath expressions into a set of abstract machine instructions specialized for stylesheet processing, wherein the set of abstract machine instructions comprises a plurality of blocks of abstract machine instructions for the compiled stylesheet and includes a backtracking abstract machine instruction for each block of the plurality of blocks;
- and
- means for executing the instructions on an abstract machine to produce an output document, wherein the abstract machine uses a plurality of types of contiguous memory storage to match requirements of the stylesheet processing and wherein the plurality of types of contiguous memory storage includes a code stack, a heap stack and a transform allocator;
- means for resetting the code stack and the heap stack upon processing completing of each block of the plurality of blocks;
- and
- means for calling a block of the plurality of blocks via a pattern match for imports which calls a template that can match with a lower import precedence than a current template,
- wherein the executing the abstract machine instruction set in the abstract machine further comprises means for processing a representation of the one or more XML documents.
Dependencies are inferred from the claim text.