On 02.11.2007 18:24 Uhr, [EMAIL PROTECTED] wrote:
Author: gkossakowski
Date: Fri Nov 2 15:24:41 2007
New Revision: 591496
URL: http://svn.apache.org/viewvc?rev=591496&view=rev
Log:
Fixed FlowJXPathSelectionList test-case by:
* fixed generation of SAX stream so if it is serialized it contains namespace
declaration (I'm not sure if it's right fix)
+ //FIXME: I added attribute for namespace declaration because it would
not be serialized otherwise
+ //why it's not printed even if we specify necessary information in
startElement() method? (GK)
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("", FormsConstants.INSTANCE_PREFIX, "xmlns:" +
FormsConstants.INSTANCE_PREFIX, AttributeTypes.CDATA, FormsConstants.INSTANCE_NS);
+ contentHandler.startElement(FormsConstants.INSTANCE_NS,
SELECTION_LIST_EL, FormsConstants.INSTANCE_PREFIX_COLON + SELECTION_LIST_EL,
attrs);
Just an explanation: A namespace declaration is not an attribute (even
if it looks so) and that's why it should not end as such. The DOM
produced by Cocoon is absolutely correct, the one by parsing expected
document in the test case is not since it has both the namespace
declaration AND an attribute xmlns:fi - which broke our test.
Joerg