Object-oriented pull model XML parser
AssigneeMicrosoft Corporation
InventorsAnders Hejlsberg, Christopher J. Lovett, Matthew J. Warren, Chia-Hsun Chen, Mark W. Fussell, Neetu Rajpal
Life of this patent
Estimating the term…
Abstract
A system and method for parsing XML is provided. The method includes associating an input stream with a pull model parser, accepting requests to selectively parse out XML items from the input stream and retrieving metadata information associated with the parsed out XML items. The method further includes checking the pulled XML item to determine whether it conforms to XML syntax and/or semantic standards and validating the pulled XML item to determine whether it conforms to a selected DTD.
Claims19
A computer system for parsing XML, the system comprising one or more computer processors and system memory, the system further comprising:
- a scanner that parses an XML stream to locate at least one XML token associated with an XML item;
- a reader that selectively pulls the XML item from the XML stream;
- and
- a retriever that retrieves information associated with the pulled XML item;
- wherein the reader and the retriever are components of a pull model XML parser that exposes an object-oriented interface that facilitates a high-level abstraction of one or more XML data sources and wherein, for the reader, the object-oriented interface exposes the public instance methods given by GetAttribute, LookupNamespace, MoveToAttribute, MoveToElement, ReadAttributeValue, ResolveEntity, and Skip.
A computer implemented method for parsing XML, the method performed by executing computer-executable instructions upon one or more computer processors, the method comprising:
- instantiating a pull model parser, wherein the pull model parser exposes an object-oriented interface that facilitates a high-level abstraction of one or more XML data sources and wherein, for an XML reader included in the parser, the object-oriented interface exposes public instance methods given by GetAttribute, LookupNamespace, MoveToAttribute, MoveToElement, ReadAttributeValue, ResolveEntity, and Skip;
- establishing a state associated with the pull model parser;
- accepting a parse request;
- selectively pulling an XML item from an XML stream based, at least in part, on the parse request;
- and
- updating the state based on the selectively pulled XML item.
A computer readable storage medium having a tangible component that stores computer executable instructions for a method for parsing XML, the method comprising:
- operably connecting a pull model parser and a state machine, wherein the pull model parser exposes an object-oriented interface that facilitates a high-level abstraction of one or more XML data sources and wherein, for an XML reader included in the parser, the object-oriented interface exposes public instance methods given by Close, Equals, GetAttribute, GetHashCode, IsStartElement, LookupNamespace, MoveToAttribute, MoveToContent, MoveToElement, MoveToFirstAttribute, MoveToNextAttribute, Read, ReadAttributeValue, ReadEndElement, ReadInnerXml, ReadStartElement, ReadString, ReadTime, ReadTimeSpan, ResolveEntity, and Skip;
- establishing an initial state in the state machine;
- accepting a parse request;
- selectively pulling a first XML item identified in the parse request from a first data store;
- based at least in part on the first XML item, selectively pulling a second XML item from a second data store;
- maintaining the state machine in response to one or more events associated with parsing and/or pulling the pulled first and second XLM items;
- checking the pulled first and second XML items to determine whether they are well-formed;
- and
- checking the pulled first and second XML items to determine whether they are valid.
Dependencies are inferred from the claim text.