Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [stp-dev] patches for bug 168833

Hi Frank,

Thanks for your help.

I have reviewed and applied those patches.

Johnson

----- Original Message ----- From: "Frank Fan" <frank.fan@xxxxxxxx>
To: <stp-dev@xxxxxxxxxxx>
Sent: Friday, December 22, 2006 11:04 AM
Subject: [stp-dev] patches for bug 168833



Hello all,

I have created two patches for bug 168833. See attached files.
Could someone help check and apply? Thank you in advance.

Frank from IONA

Below is the comment for the correction (also available in bugzilla):

Hi,

I implemented a DOM parser which is able to insert location information
into the DOM tree returned. Each element in the DOM tree is attached two
User Data named LineNumber and ColumnNumber respectively.

This parser also provides two static utility methods to directly retrieve
the line number and the column number of an element created by this parser.

Only standard JDK 1.5 libraries are used to realize this parser.

The SAXParser in library javax.xml.parsers accepts an object of class
org.xml.sax.helpers.DefaultHandler and calls the callback methods defined
in this class during the process of parsing an xml document.

SAXParser doesn't generate a DOM tree. It only parse and validate the xml
document. So a sub class of DefaultHandler is defined and in these callback
methods of the sub class, a DOM tree is created explicitly and separately.

In the test, two kinds of DOM trees are created: one by the standard JDK
parser, javax.xml.parsers.DocumentBuilder, the other by the parser in
question.
Nodes in these two trees from the same xml document are compared to
guarantee
that the DOM tree generated by the parser in question is correct.

The location information is also tested.

XML documents with and without names paces are both used to do the test.

Frank



--------------------------------------------------------------------------------


_______________________________________________
stp-dev mailing list
stp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/stp-dev




Back to the top