Claims
- 1. A method for parsing an XML document, comprising:
allowing a user to request specific XML events by calling a parsing routine, the parsing routine placing events selected by the user onto the event stream; reading the XML document with a base parser and generating a plurality of XML events, each of said XML events being associated with an element in the XML document;and constructing an event stream from the plurality of XML events.
- 2. A method according to claim 1, wherein the step of reading the XML document further comprises:
manipulating a pointer inside the XML document.
- 3. A method according to claim 1, wherein the step of reading the XML document further comprises:
using an iterative process to move through the document by element until the element associated with an XML event requested by the user is reached.
- 4. A method according to claim 1, further comprising:
selecting a base parser for reading the XML document.
- 5. A method according to claim 1, further comprising:
reading XML events from the event stream.
- 6. A method according to claim 1, wherein the step of reading the XML document includes using a base parser selected from the group consisting of DOM APIs and SAX APIs.
- 7. A method according to claim 1, further comprising:
using a scanner to read the XML document and generate tokens for use by the base parser.
- 8. A method according to claim 1, further comprising:
using JAXP to provide access to the base parser.
- 9. A method according to claim 1, further comprising:
using JAXP to select the base parser.
- 10. A method according to claim 1, wherein the step of reading the XML document with a base parser and generating a series of XML events includes generating a new XML event each time an opening tag is encountered in the XML document by the base parser.
- 11. A method for extracting a portion of an XML document, comprising:
passing the name of a selected element to be extracted from the XML document to an iterative method; reading an element tag of the XML document using a base parser; stepping through the element tags of the XML document using the iterative method and the base parser until the element tag corresponding to the selected element is located by the base parser; and extracting the selected element and placing the selected element on an event stream.
- 12. A method for extracting a selected element from an XML document, comprising:
passing the name of the selected element to a parse routine; stepping through the elements of the XML document using a base parser, the parse routine directing the base parser to continue stepping through the XML document until the selected element is located; and extracting the selected element from the XML document using the base parser and placing the selected element on an event stream.
- 13. A streaming parser for use in parsing an XML document, comprising:
a base parser programmed to read the XML document and to generate a plurality of XML events, each XML event associated with an element in the XML document; and a parsing method on top of the base parser, the parsing method stepping the base parser through the elements of the XML document until a selected element is detected, the base parser generating an event associated with the selected element and placing the event on an event stream.
- 14. A system according to claim 13, further comprising:
a scanner for reading the XML document and generating tokens to be processed by the base parser.
- 15. A system according to claim 13, further comprising:
a JAXP interface allowing a user to select a base parser.
- 16. A system according to claim 13, wherein:
said base parser is selected from the group consisting of SAX APIs and DOM APIs.
- 17. A system according to claim 13, wherein:
said base parser is further adapted to convert an event into a Java object.
- 18. A computer-readable medium, comprising:
means for reading the XML document using a base parser and generating a series of XML events, each XML event associated with an element in the XML document; means for constructing an event stream from the series of XML event; and means for allowing a user to request specific XML events by calling a parsing method, the parsing method placing events selected by the user onto the event stream.
- 19. A computer program product for execution by a computer for parsing an XML document, comprising:
computer code for reading the XML document using a base parser and generating a series of XML events, each XML event associated with an element in the XML document; computer code for constructing an event stream from the series of XML event; and computer code for allowing a user to request specific XML events by calling a parsing method, the parsing method placing events selected by the user onto the event stream.
- 20. A system for updating a data item on a network, comprising:
means for reading the XML document using a base parser and generating a series of XML events, each XML event associated with an element in the XML document; means for constructing an event stream from the series of XML event; and means for allowing a user to request specific XML events by calling a parsing method, the parsing method placing events selected by the user onto the event stream.
- 21. A computer system comprising:
a processor; object code executed by said processor, said object code configured to:
read the XML document using a base parser and generate a series of XML events, each XML event being associated with an element in the XML document; construct an event stream from the series of XML events; and allow a user to request specific XML events by calling a parsing method, the parsing method placing events selected by the user onto the event stream.
CLAIM OF PRIORITY
[0001] This application claims priority to U.S. Provisional Patent Application No. 60/362,773, filed Mar. 8, 2002, entitled “STREAMING PARSER API”, which is hereby incorporated herein by reference.
[0002] The following applications are cross-referenced and incorporated herein by reference:
[0003] U.S. patent application No. ______ entitled “SYSTEM AND METHOD FOR XML DATA BINDING” by Chris Fry and Scott Ziegler, filed ______.
[0004] U.S. patent application No. ______ entitled “SYSTEM AND METHOD FOR FAST XSL TRANSFORMATION” by Chris Fry, filed ______.
[0005] U.S. patent application No. ______ entitled “SYSTEM AND METHOD FOR XML PARSING” by Chris Fry, filed ______.
Provisional Applications (1)
|
Number |
Date |
Country |
|
60362773 |
Mar 2002 |
US |