Method for Validating Ambiguous W3C Schema Grammars
First Claim
1. A method for generating XML (Extensible Markup Language) parsers through compilation of XML Schema grammars, the method comprising:
- parsing an input document with a generated parser, where the generated parser is generated by a three-stage compilation of an XML Schema, where in a first stage the XML Schema is read and modeled in terms of abstract schema components, where in a second stage the XML Schema is augmented with a set of calculated schema components and properties used to drive code generation, and where in a third stage the XML Schema is traversed to generate validation code for each of a collection of elements;
wherein the validation code for ambiguous but legal content models is generated by;
calculating prohibited occurrence ranges for each of the plurality of particles involved;
generating code to;
evaluate each of the plurality of particles in an inner loop conditioned on an effective upper bound;
then, once the inner loop terminates, check forbidden occurrence ranges for an inner particle, and calculate a range of possible repetitions of an outer particle; and
once an outer loop terminates, check a range of total possible repetitions of the outer particle against actual occurrence limits of the outer particle.
0 Assignments
0 Petitions
Accused Products
Abstract
A method for generating XML (Extensible Markup Language) parsers, including: parsing an input document with a generated parser where the generated parser is generated by a three-stage compilation of an XML Schema, where in a first stage the XML Schema is read and modeled in terms of abstract schema components, where in a second stage the XML Schema is augmented with a set of calculated schema components and properties, and where in a third stage the XML Schema is traversed to generate validation code; the validation code is generated by: calculating prohibited occurrence ranges; generating code to: evaluate each of the plurality of particles in an inner loop conditioned on an effective upper bound; then, once the inner loop terminates, check forbidden occurrence ranges for an inner particle, and calculate a range of possible repetitions of an outer particle; and once an outer loop terminates, check a range of total possible repetitions of the outer particle against its actual occurrence limits.
28 Citations
6 Claims
-
1. A method for generating XML (Extensible Markup Language) parsers through compilation of XML Schema grammars, the method comprising:
-
parsing an input document with a generated parser, where the generated parser is generated by a three-stage compilation of an XML Schema, where in a first stage the XML Schema is read and modeled in terms of abstract schema components, where in a second stage the XML Schema is augmented with a set of calculated schema components and properties used to drive code generation, and where in a third stage the XML Schema is traversed to generate validation code for each of a collection of elements; wherein the validation code for ambiguous but legal content models is generated by; calculating prohibited occurrence ranges for each of the plurality of particles involved; generating code to; evaluate each of the plurality of particles in an inner loop conditioned on an effective upper bound; then, once the inner loop terminates, check forbidden occurrence ranges for an inner particle, and calculate a range of possible repetitions of an outer particle; and once an outer loop terminates, check a range of total possible repetitions of the outer particle against actual occurrence limits of the outer particle. - View Dependent Claims (2, 3, 4, 5, 6)
-
Specification