You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by Kevin O'Neill <ke...@rocketred.com.au> on 2003/07/12 02:02:21 UTC

[patch] getContentAsSAX has wrong default settings for namespace handling.

While working my way toward integrating xindice into the BELTS runtime
environment I came across this little problem. The namespace attributes were
being emitted twice.

Source Document
<test xmlns="http://example.com/test-1">

Content emitted by getContentAsSAX
<test xmlns="http://example.com/test-1" xmlns="http://example.com/test-1">

After some digging (and a few new test cases) I found that the
hasSaxNamespacesPrefixes of the SAXEventGenerator and XMLResourceImpl have
incorrect default values (according to
http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description)

This patch corrects this and adds the additional test cases I used to track the
problem down. It does add an addition jar dependency for the test cases though.
XMLUnit. XMLUnit provides better testing of document structure than just string
comparisons.

Patch can be found in bugzilla
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21535

-k.


RE: [patch] getContentAsSAX has wrong default settings for namespace handling.

Posted by Kevin Ross <Ke...@iVerticalLeap.com>.
I just wanted to say a big THANK YOU to Kevin O'Neill for the quality of
patches he is providing.  Each is backed by a unit test, submitted as a
universal patch (diff -u), and they always work.

Thanks again,

Kevin Ross


-----Original Message-----
From: news [mailto:news@main.gmane.org] On Behalf Of Kevin O'Neill
Sent: Friday, July 11, 2003 6:02 PM
To: xindice-dev@xml.apache.org
Subject: [patch] getContentAsSAX has wrong default settings for
namespace handling.

While working my way toward integrating xindice into the BELTS runtime
environment I came across this little problem. The namespace attributes
were
being emitted twice.

Source Document
<test xmlns="http://example.com/test-1">

Content emitted by getContentAsSAX
<test xmlns="http://example.com/test-1"
xmlns="http://example.com/test-1">

After some digging (and a few new test cases) I found that the
hasSaxNamespacesPrefixes of the SAXEventGenerator and XMLResourceImpl
have
incorrect default values (according to
http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#packag
e_description)

This patch corrects this and adds the additional test cases I used to
track the
problem down. It does add an addition jar dependency for the test cases
though.
XMLUnit. XMLUnit provides better testing of document structure than just
string
comparisons.

Patch can be found in bugzilla
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21535

-k.