IP Library Granted Patent US 8,397,158
Granted Patent B1
US 8,397,158 · App. 12/058,762 · Granted Mar 12, 2013

System and method for partial parsing of XML documents and modification thereof

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,397,158
App. No.
12/058,762
Granted
Mar 12, 2013
Kind
B1
Abstract

Modifying a partially parsed Extensible Markup Language (XML) document. A stop node in an XML document is marked using at least one stop XPath expression. The XML document is then parsed till the stop node identified by the at least one stop XPath expression. Modifications to the XML document are specified in a modification script, including at least one modification instruction. A modification instruction includes a context node XPath expression which identifies a context nodeset requiring modifications, and the actual modification content. Sequence of event tokens corresponding to the parsed XML document are then stored. Further, the XML document is modified according to the modification script.

Claims (41)

1. A computer implemented method to modify an XML document, comprising:

receiving a modification script, the modification script comprising at least one context node XPath expression and modification instructions, and at least one stop XPath expression;

identifying a context node set in an XML document using a context node XPath expression;

marking, by a computer, a stop node in a modification script of an XML document using at least one stop XPath expression to stop processing of the XML document, the modification script comprising more than one XPath expression that indicates which modifications to make and where to make the modifications;

parsing only a portion of the XML document using the modification script up to a stop node;

responsive to parsing the stop node, generating a feedback signal for discontinuing parsing of the XML document; and

processing modifications to the parsed XML document up to the stop node.

2. The computer implemented method of claim 1 , wherein the parsing comprises:

receiving the XML document as a linked list of buffers;

generating a sequence of event tokens corresponding to the nodes in the XML document;

generating XPath results by evaluating the context node XPath expression and at least one stop XPath expression on the sequence of event tokens; and

storing event tokens only corresponding to the parsed buffers.

3. The computer implemented method of claim 1 , wherein the modification script comprises instructions for each of appending, moving, modifying, deleting, adding, replacing, wrapping and capturing.

4. The computer implemented method of claim 1 , wherein the XML document is modified inline without creating an in-memory datastructure of the entire XML document.

5. The computer implemented method of claim 1 , wherein modifying the XML document comprises:

readjusting the linked list of buffers according to the modification script.

6. A computer implemented system, at least partially implemented in hardware, comprising:

a modification script compiler for compiling a modification script, the modification script comprising modification instructions including a context node XPath expression, wherein the context node XPath expression identifies a context nodeset in an XML document for modification;

an XPath parser for parsing at least one stop XPath expression to stop processing of the XML document, wherein the at least one stop XPath expression marks a stop node in the modification script of the XML document, the modification script comprising more than one XPath expression that indicates which modifications to make and where to make the modifications;

an XML parser for parsing only a portion of the XML document received as a linked list of buffers up to the stop node; and

an XPath handler for monitoring XPath results generated by an XPath processor, wherein the XML parser, responsive to parsing the stop node, generating a feedback signal for discontinuing parsing of the XML document.

7. The computer implemented system of claim 6 further comprising:

a modification script compiler for compiling a modification script, the modification script comprising modification instructions including a context node XPath expression, wherein the context node XPath expression identifies a context nodeset in an XML document for modification; and

a modification engine for modifying the XML document according to the modification script, wherein the modification engine readjusts the linked list of buffers according to the modification script.

8. The computer implemented system of claim 6 , wherein the XML parser generates a sequence of event tokens corresponding to the nodes in the XML document.

9. The computer implemented system of claim 6 , wherein the event tokens are stored only for the parsed buffers.

10. The computer implemented system of claim 6 , wherein the XPath processor generates XPath results by evaluating the context node XPath expression and the at least one stop XPath expression.

11. A non-transitory machine-readable medium product, comprising instructions operable to cause a programmable processor to perform a method, the method comprising:

receiving a modification script, the modification script comprising at least one context node XPath expression and modification instructions, and at least one stop XPath expression;

identifying a context node set in an XML document using a context node XPath expression;

marking, by a computer, a stop node in a modification script of an XML document using at least one stop XPath expression to stop processing of the XML document, the modification script comprising more than one XPath expression that indicates which modifications to make and where to make the modifications;

parsing only a portion of the XML document using the modification script up to a stop node;

responsive to parsing the stop node, generating a feedback signal for discontinuing parsing of the XML document; and

processing modifications to the parsed XML document up to the stop node.

12. The machine-readable medium product of claim 11 , wherein the parsing comprises:

receiving the XML document as a linked list of buffers;

generating a sequence of event tokens corresponding to the nodes in the XML document;

generating XPath results by evaluating the context node XPath expression and at least one stop XPath expression on the sequence of event tokens; and

storing event tokens only corresponding to the parsed buffers.

13. The machine-readable medium product of claim 11 , wherein modifying the XML document comprises:

readjusting the linked list of buffers according to the modification script.

Assignments (5)
CHANGE OF NAME Recorded Oct 5, 2017
From: GOOGLE INC.
To: GOOGLE LLC
Reel/Frame 044129/0001 →
CHANGE OF NAME Recorded Feb 13, 2017
From: SONOA NETWORKS (INDIA) PRIVATE LIMITED
To: APIGEE TECHNOLOGIES (INDIA) PRIVATE LIMITED
Reel/Frame 041696/0245 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 12, 2017
From: APIGEE CORPORATION
To: GOOGLE INC.
Reel/Frame 040955/0070 →
CHANGE OF NAME Recorded Aug 20, 2013
From: APIGEE TECHNOLOGIES (INDIA) PRIVATE LIMITED
To: APIGEE CORPORATION
Reel/Frame 031040/0098 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 31, 2008
From: NETHI, RAMESH; NANDY, KOUSIK
To: SONOA NETWORKS INDIA (PVT) LTD.
Reel/Frame 020724/0367 →