You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Jörg Heinicke (JIRA)" <ji...@apache.org> on 2005/11/23 19:34:37 UTC

[jira] Geschlossen: (COCOON-1529) I18ntranformation output xmlns:i18n in the first element

     [ http://issues.apache.org/jira/browse/COCOON-1529?page=all ]
     
Jörg Heinicke closed COCOON-1529:
---------------------------------

    Resolution: Invalid

So I hope your are ok with closing the bug. Issues with superfluous namespace declarations have to be fixed in the pipeline (if they need to be fixed at all), e.g. by adding an additional transformer or the infamous stylesheet: http://wiki.apache.org/cocoon/RemoveNamespaces.

> I18ntranformation output  xmlns:i18n in the first element
> ---------------------------------------------------------
>
>          Key: COCOON-1529
>          URL: http://issues.apache.org/jira/browse/COCOON-1529
>      Project: Cocoon
>         Type: Bug
>   Components: - Components: Sitemap
>     Versions: 2.2-dev (Current SVN)
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Juan Jose Pablos
>     Assignee: Cocoon Developers Team

>
> 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.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: superfluous namespace declarations

Posted by Geert Josten <Ge...@daidalos.nl>.
I have encountered this problem on many locations (not only with Cocoon Transformers), but there is 
a simple XSLT stylesheet that can fix this:

   <xsl:template match="comment()|processing-instruction()">
     <xsl:copy-of select="." />
   </xsl:template>

   <xsl:template match="@*">
     <xsl:attribute name="{name()}" namespace="{namespace-uri()}">
       <xsl:value-of select="." />
     </xsl:attribute>
   </xsl:template>

   <xsl:template match="*">
     <xsl:element name="{name()}" namespace="{namespace-uri()}">
       <xsl:apply-templates select="@*|node()" />
     </xsl:element>
   </xsl:template>

Regards,
Geert

Joerg Heinicke wrote:

> Juan Jose Pablos <cheche <at> apache.org> writes:
> 
> 
>>>Jörg Heinicke closed COCOON-1529:
>>>---------------------------------
>>>
>>>    Resolution: Invalid
>>
>>Hey, I am a bit lost here with this bug, are you saying that from:
>>
>><foo> to <foo  xmlns:i18n="http://apache.org/cocoon/i18n/2.1" >
>>
>>after a transformation is not a bug?
> 
> 
> Sorry, if it did not met your expectations. But yes, I don't see the above as a
> bug, but normal behaviour with XML. IIRC this behaviour results from SAX
> start/endPrefixMapping. Maybe the components consuming a specific namespace
> (like the i18n transformer) can stop propagating the events for their namespace?
> Is this possible? WDOT?
> 
> Jörg
> 
> 

-- 
Drs. G.P.H. Josten
Consultant



Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl


De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is 
uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken 
wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.

Re: superfluous namespace declarations

Posted by Carsten Ziegeler <cz...@apache.org>.
Joerg Heinicke schrieb:
> Juan Jose Pablos <cheche <at> apache.org> writes:
> 
> 
>>>Jörg Heinicke closed COCOON-1529:
>>>---------------------------------
>>>
>>>    Resolution: Invalid
>>
>>Hey, I am a bit lost here with this bug, are you saying that from:
>>
>><foo> to <foo  xmlns:i18n="http://apache.org/cocoon/i18n/2.1" >
>>
>>after a transformation is not a bug?
> 
> 
> Sorry, if it did not met your expectations. But yes, I don't see the above as a
> bug, but normal behaviour with XML. IIRC this behaviour results from SAX
> start/endPrefixMapping. Maybe the components consuming a specific namespace
> (like the i18n transformer) can stop propagating the events for their namespace?
> Is this possible? WDOT?
> 
Yes, it's possible and some of our transformers already do this (include
and cinclude transformer for example). Of course this requires that the
transformer consumes all elements/attributes in this namespace.

Now, if the transformer extends the AbstractSAXTransformer than you just
have to set a boolean flag (don't remember the name and I don't have
access to the code right now) in the constructor of your transformer to
true and that's it. So, adding this "feature" should be really simple.

Carsten
-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

superfluous namespace declarations (was: [jira] Geschlossen: (COCOON-1529) I18ntranformation output xmlns:i18n in the first element)

Posted by Joerg Heinicke <jo...@gmx.de>.
Juan Jose Pablos <cheche <at> apache.org> writes:

> > Jörg Heinicke closed COCOON-1529:
> > ---------------------------------
> > 
> >     Resolution: Invalid
> 
> Hey, I am a bit lost here with this bug, are you saying that from:
> 
> <foo> to <foo  xmlns:i18n="http://apache.org/cocoon/i18n/2.1" >
> 
> after a transformation is not a bug?

Sorry, if it did not met your expectations. But yes, I don't see the above as a
bug, but normal behaviour with XML. IIRC this behaviour results from SAX
start/endPrefixMapping. Maybe the components consuming a specific namespace
(like the i18n transformer) can stop propagating the events for their namespace?
Is this possible? WDOT?

Jörg


Re: [jira] Geschlossen: (COCOON-1529) I18ntranformation output xmlns:i18n in the first element

Posted by Juan Jose Pablos <ch...@apache.org>.
Jörg Heinicke (JIRA) wrote:
>      [ http://issues.apache.org/jira/browse/COCOON-1529?page=all ]
>      
> Jörg Heinicke closed COCOON-1529:
> ---------------------------------
> 
>     Resolution: Invalid
> 
> So I hope your are ok with closing the bug. Issues with superfluous namespace declarations have to be fixed in the pipeline (if they need to be fixed at all), e.g. by adding an additional transformer or the infamous stylesheet: http://wiki.apache.org/cocoon/RemoveNamespaces.
> 
> 
> 

Hey, I am a bit lost here with this bug, are you saying that from:

<foo>

to

<foo  xmlns:i18n="http://apache.org/cocoon/i18n/2.1" >

after a transformation is not a bug?