cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johannes Textor (JIRA)" <j...@apache.org>
Subject [jira] Updated: (COCOON-1529) I18nTranformer should consume and stop propagating start/endPrefixMapping of its namespace
Date Wed, 20 Feb 2008 16:51:43 GMT

     [ https://issues.apache.org/jira/browse/COCOON-1529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Johannes Textor updated COCOON-1529:
------------------------------------

    Attachment: I18nTransformer.java.diff

IMHO, there is no reason that i18n transformer should propagate its namespace, since it consumes
all elements in that namespace. The remaining xmlns attribute is annoying if one serializes
to XHTML, since the result is not valid. It is of course possible to "fix" this problem by
adding an additional transformation step to each pipeline to drop the namespaces, but that
costs performance and messes up the sitemap code.

I looked into Joerg's AbstractSAXTransformer but I think that I18nTransformer should not be
refactored to inherit from it; AbstractSAXTransformer is based on the assumption that the
transformer will only use elements within a given namespace, but I18nTransformer also translates
*attributes* on elements which might be in a different namespace (via i18n:attr). OTOH, AbstractSAXTransformer
does a lot of things such as keeping track of all namespaces and calling extra "hook" methods
which are not needed by  I18nTransformer and would just slow it down.

Attached is a simple patch (against I18nTransformer.java as of 20 Feb. 2008) which achieves
the desired effect by simply dropping all prefix mappings which are in one of the i18n namespaces.
WDYT?


> I18nTranformer should consume and stop propagating start/endPrefixMapping of its namespace
> ------------------------------------------------------------------------------------------
>
>                 Key: COCOON-1529
>                 URL: https://issues.apache.org/jira/browse/COCOON-1529
>             Project: Cocoon
>          Issue Type: Bug
>          Components: - Components: Sitemap
>    Affects Versions: 2.1.8, 2.1.9, 2.2-dev (Current SVN)
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Juan Jose Pablos
>            Priority: Minor
>         Attachments: I18nTransformer.java.diff
>
>
> This is a strage bug.
> on http://localhost:8888/samples/i18n/simple.xml around line 183:
>   <annotation xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
> This produces wrong xml output (extra xmlns:i18n attribute).
> now if you commented out the annotation element then the xmlns:i18n attribute
> goes to the next element:
>  <content xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
> It looks like it goes to the parent element always.
> I wish that I could have more information about how to resolve this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message