You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Alex Romayev <ro...@yahoo.com> on 2002/08/07 16:58:49 UTC

Leftover tags from I18n

Hi, I'm having problems with i18n tags left after I18n
Transformation.  The resultant html does not seem to
like them too much :)

The following fragment uses I18nTransformer:

<map:match pattern="content/coordinates-summary">
  <map:generate src="content/coordinates.xml"/>
  <map:transform
src="stylesheets/coordinates-summary.xsl"/>
  <map:transform type="i18n"/>
  <map:serialize type="html"/>
</map:match>

coordinates-summary.xsl includes:
"        <a href="#"><i18n:text
key="coordinates">coordinates</i18n:text></a>"

This fragment aggregates the results from the first
fragment and generates html.

<map:match pattern="content/homepage">
  <map:aggregate element="page">
    <map:part
src="cocoon:/content/coordinates-summary"
element="coordinates-summary"/>
    ...
  </map:aggregate>
  <map:transform src="stylesheets/homepage.xsl"/>
  <map:serialize type="xml"/>
</map:match>

Any ideas?

Thanks,
-Alex

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Leftover tags from I18n

Posted by Alex Romayev <ro...@yahoo.com>.
Joerg, thanks very much for your help.

Let me try to address both points.

1.Building pages from modules:

My home page consists of navigation, news summary,
coordinates summary and other page modules. 
Navigation module is shared by all pages.  What I
would like to do, is to effectively build a page by
assembling it from page modules.  It seems to make
sense to me, that each module should do all the
necessary work (transformations, logic, etc) to
produce the resultant html to be integrated into the
page(s) containing it.  Here is an illustrative
pipeline I would use for this purpose:

I'm matching homepage for clarity, but basically I
would match any page to be able to re-use the
navigation module.
     <map:match pattern="homepage">
        <map:aggregate element="page">
          <map:part src="cocoon:/content/navigation"/>
          <map:part src="cocoon:/content/homepage"/>
        </map:aggregate>
        <map:transform
src="stylesheets/simple-page2html.xsl"/>
        <map:transform type="i18n"/>
        <map:serialize/>
      </map:match>

Now assemble homepage from news summary and
coordinates summary modules:

      <map:match pattern="content/homepage">
        <map:aggregate element="page">
          <map:part
src="cocoon:/content/homepage/coordinates-summary"
element="coordinates-summary"/>
          <map:part
src="cocoon:/content/homepage/news-summary"
element="news-summary"/>
        </map:aggregate>
        <map:transform
src="stylesheets/homepage.xsl"/>
        <map:serialize type="xml"/>
      </map:match>

      <map:match pattern="content/homepage/*">
        <map:generate src="content/{1}.xml"/>
        <map:transform src="stylesheets/{1}.xsl"/>
        <map:serialize type="xml"/>
      </map:match>

Is there a better way of doing it? -- I fairly new to
Cocoon, so if there are established ways to getting
this done, I wouldn't want to re-invent the wheel ;) 

2. Leftover tags
As the result of all the transformations I get the
following html fragment:

<div xmlns:i18n="http://apache.org/cocoon/i18n/2.0"
id="news-summary">
  <div class="module-header">News</div>
</div>

Now it doesn't interfere with page rendering, but it
would be nice not to have it there at all� 

Cheers,
-Alex
--- Joerg Heinicke <jo...@gmx.de> wrote:
> Hmm, I have not enough information to see whether
> it's good or bad. It 
> sounds not sooo bad ;-)
> 
> If still elements with i18n namespace prefix remain,
> check whether this 
> prefix is bound to the correct namespace uri. Have a
> look at the XML before 
> the i18n transformer transforms it and look whether
> the i18n namespace 
> prefix is everywhere in the file bound to
> "http://apache.org/cocoon/i18n/2.0".
> 
> Regards,
> 
> Joerg
> 
> 
> Alex Romayev wrote:
> > Thanks Joerg,
> > 
> > You're right, it was something else and I did move
> the
> > i18n to be the last step -- the tags are still
> there,
> > but it doesn't seem to matter...
> > 
> > Regarding html, I'm generating
> "coordinates-summary"
> > as xhtml (hence, trasform type is "xml") and then
> > aggregating with other modules within my
> "homepage",
> > which is then aggregated with "navigation" in
> another
> > pipleline (not shown).  Is there a better way of
> doing
> > that?
> > 
> > 
> > --- Joerg Heinicke <jo...@gmx.de> wrote:
> > 
> >>This works (without i18n) in general?
> >>
> >>You serialize content/coordinates-summary as html
> >>and include this in an 
> >>aggregation. In my understanding this can't be
> >>correct. Why aren't you using 
> >>the i18n as last transformer before *finally*
> >>serializing it before 
> >>response. In your sitemap snippet this means (as
> far
> >>as I can see) add it 
> >>between these two lines:
> >>
> >> >   <map:transform
> src="stylesheets/homepage.xsl"/>
> >> >   <map:serialize type="xml"/>
> >>
> >>Regards,
> >>
> >>Joerg
> >>
> >>
> >>
> >>Alex Romayev wrote:
> >>
> >>>Hi, I'm having problems with i18n tags left after
> >>
> >>I18n
> >>
> >>>Transformation.  The resultant html does not seem
> >>
> >>to
> >>
> >>>like them too much :)
> >>>
> >>>The following fragment uses I18nTransformer:
> >>>
> >>><map:match pattern="content/coordinates-summary">
> >>>  <map:generate src="content/coordinates.xml"/>
> >>>  <map:transform
> >>>src="stylesheets/coordinates-summary.xsl"/>
> >>>  <map:transform type="i18n"/>
> >>>  <map:serialize type="html"/>
> >>></map:match>
> >>>
> >>>coordinates-summary.xsl includes:
> >>>"        <a href="#"><i18n:text
> >>>key="coordinates">coordinates</i18n:text></a>"
> >>>
> >>>This fragment aggregates the results from the
> >>
> >>first
> >>
> >>>fragment and generates html.
> >>>
> >>><map:match pattern="content/homepage">
> >>>  <map:aggregate element="page">
> >>>    <map:part
> >>>src="cocoon:/content/coordinates-summary"
> >>>element="coordinates-summary"/>
> >>>    ...
> >>>  </map:aggregate>
> >>>  <map:transform src="stylesheets/homepage.xsl"/>
> >>>  <map:serialize type="xml"/>
> >>></map:match>
> >>>
> >>>Any ideas?
> >>>
> >>>Thanks,
> >>>-Alex
> 
> -- 
> 
> System Development
> VIRBUS AG
> Fon  +49(0)341-979-7419
> Fax  +49(0)341-979-7409
> joerg.heinicke@virbus.de
> www.virbus.de
> 
> 
>
---------------------------------------------------------------------
> Please check that your question  has not already
> been answered in the
> FAQ before posting.    
> <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:    
> <co...@xml.apache.org>
> For additional commands, e-mail:  
> <co...@xml.apache.org>
> 


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Leftover tags from I18n

Posted by Joerg Heinicke <jo...@gmx.de>.
Hmm, I have not enough information to see whether it's good or bad. It 
sounds not sooo bad ;-)

If still elements with i18n namespace prefix remain, check whether this 
prefix is bound to the correct namespace uri. Have a look at the XML before 
the i18n transformer transforms it and look whether the i18n namespace 
prefix is everywhere in the file bound to "http://apache.org/cocoon/i18n/2.0".

Regards,

Joerg


Alex Romayev wrote:
> Thanks Joerg,
> 
> You're right, it was something else and I did move the
> i18n to be the last step -- the tags are still there,
> but it doesn't seem to matter...
> 
> Regarding html, I'm generating "coordinates-summary"
> as xhtml (hence, trasform type is "xml") and then
> aggregating with other modules within my "homepage",
> which is then aggregated with "navigation" in another
> pipleline (not shown).  Is there a better way of doing
> that?
> 
> 
> --- Joerg Heinicke <jo...@gmx.de> wrote:
> 
>>This works (without i18n) in general?
>>
>>You serialize content/coordinates-summary as html
>>and include this in an 
>>aggregation. In my understanding this can't be
>>correct. Why aren't you using 
>>the i18n as last transformer before *finally*
>>serializing it before 
>>response. In your sitemap snippet this means (as far
>>as I can see) add it 
>>between these two lines:
>>
>> >   <map:transform src="stylesheets/homepage.xsl"/>
>> >   <map:serialize type="xml"/>
>>
>>Regards,
>>
>>Joerg
>>
>>
>>
>>Alex Romayev wrote:
>>
>>>Hi, I'm having problems with i18n tags left after
>>
>>I18n
>>
>>>Transformation.  The resultant html does not seem
>>
>>to
>>
>>>like them too much :)
>>>
>>>The following fragment uses I18nTransformer:
>>>
>>><map:match pattern="content/coordinates-summary">
>>>  <map:generate src="content/coordinates.xml"/>
>>>  <map:transform
>>>src="stylesheets/coordinates-summary.xsl"/>
>>>  <map:transform type="i18n"/>
>>>  <map:serialize type="html"/>
>>></map:match>
>>>
>>>coordinates-summary.xsl includes:
>>>"        <a href="#"><i18n:text
>>>key="coordinates">coordinates</i18n:text></a>"
>>>
>>>This fragment aggregates the results from the
>>
>>first
>>
>>>fragment and generates html.
>>>
>>><map:match pattern="content/homepage">
>>>  <map:aggregate element="page">
>>>    <map:part
>>>src="cocoon:/content/coordinates-summary"
>>>element="coordinates-summary"/>
>>>    ...
>>>  </map:aggregate>
>>>  <map:transform src="stylesheets/homepage.xsl"/>
>>>  <map:serialize type="xml"/>
>>></map:match>
>>>
>>>Any ideas?
>>>
>>>Thanks,
>>>-Alex

-- 

System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@virbus.de
www.virbus.de


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Leftover tags from I18n

Posted by Alex Romayev <ro...@yahoo.com>.
Thanks Joerg,

You're right, it was something else and I did move the
i18n to be the last step -- the tags are still there,
but it doesn't seem to matter...

Regarding html, I'm generating "coordinates-summary"
as xhtml (hence, trasform type is "xml") and then
aggregating with other modules within my "homepage",
which is then aggregated with "navigation" in another
pipleline (not shown).  Is there a better way of doing
that?


--- Joerg Heinicke <jo...@gmx.de> wrote:
> This works (without i18n) in general?
> 
> You serialize content/coordinates-summary as html
> and include this in an 
> aggregation. In my understanding this can't be
> correct. Why aren't you using 
> the i18n as last transformer before *finally*
> serializing it before 
> response. In your sitemap snippet this means (as far
> as I can see) add it 
> between these two lines:
> 
>  >   <map:transform src="stylesheets/homepage.xsl"/>
>  >   <map:serialize type="xml"/>
> 
> Regards,
> 
> Joerg
> 
> 
> 
> Alex Romayev wrote:
> > Hi, I'm having problems with i18n tags left after
> I18n
> > Transformation.  The resultant html does not seem
> to
> > like them too much :)
> > 
> > The following fragment uses I18nTransformer:
> > 
> > <map:match pattern="content/coordinates-summary">
> >   <map:generate src="content/coordinates.xml"/>
> >   <map:transform
> > src="stylesheets/coordinates-summary.xsl"/>
> >   <map:transform type="i18n"/>
> >   <map:serialize type="html"/>
> > </map:match>
> > 
> > coordinates-summary.xsl includes:
> > "        <a href="#"><i18n:text
> > key="coordinates">coordinates</i18n:text></a>"
> > 
> > This fragment aggregates the results from the
> first
> > fragment and generates html.
> > 
> > <map:match pattern="content/homepage">
> >   <map:aggregate element="page">
> >     <map:part
> > src="cocoon:/content/coordinates-summary"
> > element="coordinates-summary"/>
> >     ...
> >   </map:aggregate>
> >   <map:transform src="stylesheets/homepage.xsl"/>
> >   <map:serialize type="xml"/>
> > </map:match>
> > 
> > Any ideas?
> > 
> > Thanks,
> > -Alex
> 
> 
> -- 
> 
> System Development
> VIRBUS AG
> Fon  +49(0)341-979-7419
> Fax  +49(0)341-979-7409
> joerg.heinicke@virbus.de
> www.virbus.de
> 
> 
>
---------------------------------------------------------------------
> Please check that your question  has not already
> been answered in the
> FAQ before posting.    
> <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:    
> <co...@xml.apache.org>
> For additional commands, e-mail:  
> <co...@xml.apache.org>
> 


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Leftover tags from I18n

Posted by Joerg Heinicke <jo...@gmx.de>.
This works (without i18n) in general?

You serialize content/coordinates-summary as html and include this in an 
aggregation. In my understanding this can't be correct. Why aren't you using 
the i18n as last transformer before *finally* serializing it before 
response. In your sitemap snippet this means (as far as I can see) add it 
between these two lines:

 >   <map:transform src="stylesheets/homepage.xsl"/>
 >   <map:serialize type="xml"/>

Regards,

Joerg



Alex Romayev wrote:
> Hi, I'm having problems with i18n tags left after I18n
> Transformation.  The resultant html does not seem to
> like them too much :)
> 
> The following fragment uses I18nTransformer:
> 
> <map:match pattern="content/coordinates-summary">
>   <map:generate src="content/coordinates.xml"/>
>   <map:transform
> src="stylesheets/coordinates-summary.xsl"/>
>   <map:transform type="i18n"/>
>   <map:serialize type="html"/>
> </map:match>
> 
> coordinates-summary.xsl includes:
> "        <a href="#"><i18n:text
> key="coordinates">coordinates</i18n:text></a>"
> 
> This fragment aggregates the results from the first
> fragment and generates html.
> 
> <map:match pattern="content/homepage">
>   <map:aggregate element="page">
>     <map:part
> src="cocoon:/content/coordinates-summary"
> element="coordinates-summary"/>
>     ...
>   </map:aggregate>
>   <map:transform src="stylesheets/homepage.xsl"/>
>   <map:serialize type="xml"/>
> </map:match>
> 
> Any ideas?
> 
> Thanks,
> -Alex


-- 

System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@virbus.de
www.virbus.de


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>