cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paint...@mc.duke.edu
Subject RE: Calling a logic-sheet using a parameter
Date Fri, 27 Apr 2001 15:11:26 GMT

Tony,

yes, you can use Java.  When you use the <?xml-logicsheet?> processing
instruction, the stylesheet gets applied during XSP processing.  It doesn't
matter whether it is before or after the <?cocoon-process type="xsp"?>
processing instruction.  If you want to use this as a pure stylesheet, you
would use the <?xml-stylesheet?> processing instruction.

I always put my <?xml-logicsheet?> instructions after my <?cocoon-process
type="xsp"?> instruction.  Works fine.

-Christopher




Please respond to cocoon-users@xml.apache.org

To:   <cocoon-users@xml.apache.org>
cc:

Subject:  RE: Calling a logic-sheet using a parameter


Konstantin,

If you look at my pipline, my Translate.xsl logic-sheet is positionned
after
XSP, thus I cannot but any java on it.
Thus Translate.xsl is purely XSLT and is used more as a Style-sheet than a
logic sheet. It has the following on it:


<xsl:template match="*[@lang]">
          <xsl:variable name="idText" select="node()"/>
          <xsl:variable name="idLang" select="@lang"/>
     <xsl:copy>
          <xsl:copy-of select="@*"/><!--copy of all attributes-->
          <xsl:value-of
select="document('dico.xml')/dico/text[./translation[@lang=$idLang]
=$idText]
/translation[@lang='fr']"/>
          <xsl:apply-templates select="*" />
     <!-- only elements, no text nodes -->
     </xsl:copy>
</xsl:template>>

This does the language string filtering


What I want is to have the in [@lang='fr'] 'fr' as a parameter.

Tony.



-----Original Message-----
> From: Piroumian, Konstantin [mailto:KPiroumian@flagship.ru]
> Sent: sexta-feira, 27 de abril de 2001 10:18
> To: cocoon-users@xml.apache.org
> Subject: Re: Calling a logic-sheet using a parameter
>
>
> Hi!
> To use a parameter inside your logicsheet you have to use either request
> taglib or do it manualy:
> String lang = request.getParameter("lang");
> if (lang != null) {
>     translate(lang);
> }
>
> Something like that.
> Personally, I use FP taglib for translation and use the lang
> attribute from
> session (or request) to get the appropriate node from the dictionary.
>
> Another (and, IMO, better) way to do translations is to use the Infozone
> Group's I18nProcessor (http://www.infozone-group.org).
>
> Regards,
>     Konstantin Piroumian.
> >
> > Hi there,
> >
> > Cocoon 1.8.2.
> >
> > My cocoon pipline is as follow:
> >
> > <?xml version="1.0"?>
> > <?xml-logicsheet href="../LogicSheets/TLUtils.xsl"?>
> > <?xml-logicsheet href="../LogicSheets/TLsystem.xsl"?>
> > <?cocoon-process type="xsp"?>
> > <?xml-logicsheet href="../Translate/translate.xsl"?>
> > <?cocoon-format type="text/html"?>
> > <?cocoon-process type="xslt"?>
> > <?xml-stylesheet href="../Stylesheets/default.xsl" type="text/xsl"?>
> >
> > My question is regarding the "translate.xsl" bit that is called
> after XSP.
> > Basically this template filters' all the XML tags produced that have a
> > lang="en" parameter returns their equivalent value from a XML
dictionary
> > file in the required language "fr", "it", etc...
> >
> > It work fine and this is a nice way of doing transaltion!
> >
> > Thus what I want is to pass a parameter to this logicsheet "fr", "it",
> > etc... An I don't know how to do this using cocoon.
> >
> > I am reading faqs and docs but so far nada...
> >
> > Could someone put me on the right direction ?
> >
> > Tony.
> >
> >
> >
> >





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

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


Mime
View raw message