Browse Prior Art Database

Method For Maintaining XML Integrity Using SAX Parsing And XPATH

IP.com Disclosure Number: IPCOM000018738D
Original Publication Date: 2003-Aug-04
Included in the Prior Art Database: 2003-Aug-04
Document File: 3 page(s) / 125K

Publishing Venue

IBM

Abstract

When using a SAX Parser to parse the XML, it is likely that if you are only interested in one of the many processes, or only a subset of the XML in general, that the extra XML that is not pertinent to you will be discarded, while the relevant data will be stored in memory for some use or manipulation. Upon serialization of the relevant data, all information deemed non-pertinent by your process will be lost. This method preserves this information.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 53% of the total text.

Page 1 of 3

Method For Maintaining XML Integrity Using SAX Parsing And XPATH

The Problem

Since XML is extensible, it may contain information for performing several processes. When using a SAX Parser to parse the XML, it is likely that if you are only interested in one of the many processes, or only a subset of the XML in general, that the extra XML that is not pertinent to you will be discarded, while the relevant data will be stored in memory for some use or manipulation. Upon serialization of the relevant data, all information deemed non-pertinent by your process will be lost. This is illustrated in the diagram below.

This can be a problem if the XML was designed to be used by a third party process as well as your own, since information in the XML that was intended for the third party process has been lost.

Solution

To solve this problem, XPATH is used. XPATH is a standard for defining the precise location of an XML Element in a XML file (for more information on XPATH, see HYPERLINK "http://www.w3.org/TR/xpath"http://www.w3.org/TR/xpath ). When non-pertinent data is encountered, the XPATH should be computed and saved. Upon serialization, these paths should be examined and there new location in the

1

[This page contains 1 picture or other non-text object]

Page 2 of 3

XML file computed based on the XPATH information.

Solution Example Walk Through

To illustrate the problem and solution, a simple walk through problem follows. The sample is based on a XML file intended for use by separate processes which do not know about each other. The XML is related to printing, with process 1 being a formatting application's information, and process 2 being a printing application's information. The formatting application creates a new file based on variable data information stored in the XML, then places the file in a hotfolder. The printing application polls the hotfolder and prints all files in the directory.

Here is a sample piece of XML:

<RootTag>

<Pr...