Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.1.12
-
None
-
None
Description
Pipeline:
<map:generate src="test.xml"/>
<map:transform type="i18n"/>
<map:serialize type="xml"/>
Source document (test.xml):
<?xml version="1.0" encoding="UTF-8"?>
<document>
<i18n:text xmlns:i18n="http://apache.org/cocoon/i18n/2.1">foo</i18n:text>
<element/>
</document>
Output of XMLSerializer:
<?xml version="1.0" encoding="UTF-8"?>
<document>
foo
<element xmlns:xml="http://www.w3.org/XML/1998/namespace"/>
</document>
The xmlns:xml declaration is added due to an underflow of the Namespaces stack. The field Namespaces.last becomes 1 and therefore the xml namespace is committed (which I guess should never happen). I'm not sure yet if this is a problem of the serializers block or maybe of the I18nTransformer.
The problem is that this happens when generating RSS feeds, and IE doesn't accept them if they contain namespace declarations.
<map:generate src="test.xml"/>
<map:transform type="i18n"/>
<map:serialize type="xml"/>
Source document (test.xml):
<?xml version="1.0" encoding="UTF-8"?>
<document>
<i18n:text xmlns:i18n="http://apache.org/cocoon/i18n/2.1">foo</i18n:text>
<element/>
</document>
Output of XMLSerializer:
<?xml version="1.0" encoding="UTF-8"?>
<document>
foo
<element xmlns:xml="http://www.w3.org/XML/1998/namespace"/>
</document>
The xmlns:xml declaration is added due to an underflow of the Namespaces stack. The field Namespaces.last becomes 1 and therefore the xml namespace is committed (which I guess should never happen). I'm not sure yet if this is a problem of the serializers block or maybe of the I18nTransformer.
The problem is that this happens when generating RSS feeds, and IE doesn't accept them if they contain namespace declarations.