主权项 |
1. A method comprising:
reading, by an RTF (Rich Text Format) reader executed on a computer system, a first portion of a first template document expressed in RTF format, wherein the first portion is an initial portion of the first template document, corresponds to a paragraph block in the first template document, and defines within content of the first portion of the first template document a type and one or more attributes; instantiating, by an RTF (Rich Text Format) parser executed on the computer system, a root data object based on the type and one or more attributes associated with the first portion, wherein the root data object includes an executable method for outputting source code in Extensible Stylesheet Language (XSL) format that corresponds to the first portion; reading, by the RTF (Rich Text Format) reader, a second portion of the first template document, wherein the second portion is a next portion of the first template document after the initial portion of the first template document, defines within content of the second portion of the first template document a type and one or more attributes including a placeholder tag, a transformation tag, a block of static content, or a formatting attribute in the first template document; instantiating, by the RTF (Rich Text Format) parser, a child data object based on the type and one or more attributes of the second portion, wherein the child data object is instantiated as a child of the root data object in an object hierarchy, and wherein the child data object includes an executable method for outputting source code in XSL format that corresponds to the second portion; generating, by the RTF (Rich Text Format) parser, a second template document expressed in XSL format and based on a hierarchy of the first template document represented by the root data object and the child data object by executing the method included in the root data object and the method included in the child data object; and combining, by the computer system, the second template document with report data to generate a report. |