Conversion of plain text to XML
AssigneeInternational Business Machines Corporation
InventorEhud Aharoni
Life of this patent
Estimating the term…
Abstract
Methods and systems are provided for converting text to XML code. A schema is applied to the text. The schema is a XML-compliant template that incorporates a single enhanced regular expression. One enhancement causes the matched text to be concatenated and displayed. The concatenated matched text is merged with the template to generate a markup language-compliant output. The enhanced regular expression can include a grouping operator that is nestable within another regular expression operator, for example the “*” operator that matches zero or more instances of its operand. Special purpose tags may be defined in the schema to represent regular expression operators.
Claims17
A method of converting text to code that is compliant with a markup language, comprising the steps of:
- applying a schema to said text, wherein said schema comprises a regular expression having printer tokens embedded therein and having sections, each of said sections being delimited by a grouping operator, wherein said schema comprises special purpose tags that are compliant with said markup language, said special purpose tags respectively encoding regular expression operators, wherein applying said schema comprises applying said encoded regular expression operators to said text for matching thereof;
- matching said text with said regular expression to identify portions of said text that match each of said sections;
- and
- for each of said sections concatenating said printer tokens and respective identified portions of said text to generate an output that is compliant with said markup language, printer tokens each for generating a constant string.
A computer software product for converting text to code that is compliant with a markup language, including a tangible computer-readable medium in which computer program instructions are stored, which instructions, when read by a computer, cause the computer to:
- apply a schema to said text, wherein said schema comprises a regular expression having printer tokens embedded therein and having sections, each of said sections being delimited by a grouping operator, wherein said schema comprises special purpose tags that are compliant with said markup language, said special purpose tags respectively encoding regular expression operators, wherein applying said schema comprises applying said encoded regular expression operators to said text for matching thereof;
- match said text with said regular expression to identify portions of said text that match each of said sections;
- and
- for each of said sections concatenate said printer tokens and respective identified portions of said text to generate an output that is compliant with said markup language, printer tokens each for generating a constant string.
A data processing system for converting text to code that is compliant with a markup language, comprising:
- a memory accessible having a schema stored therein, wherein said schema comprises a regular expression having printer tokens embedded therein and having sections, each of said sections being delimited by a grouping operator, wherein said schema comprises special purpose tags that are compliant with said markup language, said special purpose tags respectively encoding regular expression operators, wherein applying said schema comprises applying said encoded regular expression operators to said text for matching thereof;
- a processor operative to:
- receive said text as input;
- apply said schema to said text to identify portions of said text that match each of said sections;
- and
- for each of said sections concatenate said printer tokens and respective identified portions of said text to generate an output that is compliant with said markup language, printer tokens each for generating a constant string.
Dependencies are inferred from the claim text.