cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <g...@tuffmail.com>
Subject Broken test-cases due to missing namespace declarations (was: Re: svn commit: r597535 - in /cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src: main/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionList.java test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java)
Date Thu, 27 Dec 2007 14:00:55 GMT
Joerg Heinicke pisze:
> Grek, thanks for your work on this. I figured out the missing pieces.

Great, thanks! :)

> First, I did not know that DOM is slightly different than the theory of
> XML.

Nor I did at the firs time. ;)

> Second, that's not quite correct. Xalan 2.7.1 fixes the issue. Our
> DOMBuilder is only a wrapper. It does not replace the Xalan DOMBuilder
> at all.

I'm not sure if it's only me but this wrapper is not as simple as I would like to see it.
From just
look at the code of our wrapper it is quite hard to figure out that it uses DOMBuilder from
Xalan.
Isn't it?
Can this be simplified?

> Third, there is a missing piece though to make it work: The fix for
> XALANJ-2091 is triggered by startPrefixMapping(). With
> FlowJXPathSelectionList.generateSaxFragment() as in the test case
> without the actual CForms framework code startPrefixMapping() is never
> called. After I added startPrefixMapping() at the very beginning of
> FlowJXPathSelectionList.generateSaxFragment() and endPrefixMapping() at
> the end of it (though there is still an issue with the missing
> implementation of the latter [1]) the test passed without the explicit
> removal of the namespace attribute.

Ah, here is the missing detail! :-)
I'm very happy to hear that we have some progress on this annoying issue.

> The question is if we really want to change all places where this
> applies and add start/endPrefixMapping(). In theory that's the correct
> way to do it. Another possibility to fix the tests would be to serialize
> the XML from the actual test run and reparse it in the same way as the
> documents we compare to.

I opt for fixing our code by adding start/endPrefixMapping() as it seems to be the cleanest
possible
solution. Apart from that I think that SAX spec. enfornces on us to use these methods if we
want to
produce proper (representing well-formed XML) stream of SAX events.
I'm happy to help (or even take care of all the task) with fixing our code.

The only problem I can see now is that Xalan 2.7.1 is _not_ available on Maven central repository.
Do you have an idea how to quickly add it to repository? Should we ask Xalan people to upload
it or
should we go for standard procedure (creating issue in Maven jira and attaching artifacts)?
What's more, it seems that jars of older Xalan versions available on Maven repository is not
the
same as jars in archive downloaded from Xalan site. The later is split into two jars:
* xalan.jar
* serializer.jar
whereas jar from repository has classes from both xalan.jar and serializer.jar.

-- 
Grzegorz Kossakowski

Mime
View raw message