cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Billard <obill...@rennes.jouve.fr>
Subject Re: Using built-in stylesheets tags in other built-in stylesheets
Date Fri, 18 Jul 2003 07:33:55 GMT
Thanks Steven,

I didn't have to split those templates.
It works fine for me...

May it come from the xerces version ?

--
Olivier


Steven Cummings wrote:
> Just an FYI:
> 
> I've sometimes gotten a NullPointer exception when trying to <apply-templates
> select="@*"/> where the current node wasn't an element. As a result, I split my
> "pass-through" templates into two templates:
> 
> <xsl:template match="*" priority="-1">
>   <xsl:copy>
>     <xsl:apply-templates select="@*|node()"/>
>   </xsl:copy>
> </xsl:template>
> 
> <xsl:template match="@*|text()|processing-instruction()|comment()"
> priority="-1">
>   <xsl:copy>
>     <xsl:apply-templates select="node()"/>
>   </xsl:copy>
> </xsl:template>
> 
> I might have seen this done elsewhere when I first encountered the problem but
> I don't remember exactly.
> 
> /S
> 
> --- Olivier Billard <obillard@rennes.jouve.fr> wrote:
> 
>>Hi Adrian,
>>
>>I didn't saw that the
>>     <xsl:template match="@*|*|text()|processing-instruction()"
>>priority="-2">
>>       <xsl:copy>
>>          <xsl:apply-templates
>>select="@*|*|text()|processing-instruction()"/>
>>       </xsl:copy>
>>     </xsl:template>
>>
>>missed the <xsl:copy>... (damned)
>>
>>Thank a lot !
>>
>>--
>>Olivier Billard
>>
>>
>>
>>
>>adrian.geissel@ecb.int wrote:
>>
>>
>>>Hi Oliver,
>>>
>>>For a logicsheet to work properly, you must 
>>>
>>>a) provide a default transformation for elements not handled by your XSL
>>>eg.
>>>  <xsl:template match="@*|*|text()|processing-instruction()" priority="-2">
>>>     <xsl:copy>
>>>        <xsl:apply-templates
>>
>>select="@*|*|text()|processing-instruction()"/>
>>
>>>     </xsl:copy>
>>>  </xsl:template>
>>>
>>>and 
>>>b) you must have a root <xsp:page/> handler, to kick the whole thing off:
>>>
>>>  <xsl:template match="xsp:page">
>>>    <xsp:page>
>>>      <xsl:apply-templates select="@*|*"/>
>>>    </xsp:page>
>>>  </xsl:template>
>>>
>>>
>>>Then, all you need to do is call <xsl:apply-templates/> in the spots in
>>
>>your
>>
>>>logic where you want the nested logic-tags to be evaluated.
>>>
>>>HTH
>>>/Adrian
>>>
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: Olivier Billard [mailto:obillard@rennes.jouve.fr]
>>>>Sent: Thursday 17 July 2003 17:03
>>>>To: dev@cocoon.apache.org
>>>>Subject: Re: Using built-in stylesheets tags in other built-in
>>>>stylesheets
>>>>
>>>>
>>>>Hi Tim,
>>>>
>>>>Thanks for your answer.
>>>>
>>>>I've tried
>>>>xsp < esql < mystylesheet
>>>>and xsp < mystylesheet < esql
>>>>
>>>>and none worked...
>>>>
>>>>It seems that order in namespace declaration is no longer 
>>>>taken into consideration...
>>>>
>>>>Any other idea ?
>>>>
>>>>
>>>>-- 
>>>>Olivier BILLARD
>>>>
>>>>
>>>>
>>>>Tim Myers wrote:
>>>>
>>>>
>>>>
>>>>>The stylesheets get chained together in a pipeline one 
>>>>
>>>>after the other.  The
>>>>
>>>>
>>>>>only issue of one stylesheet using another is order in the 
>>>>
>>>>pipeline.  Your xsp 
>>>>
>>>>
>>>>>must be transformed by any logicsheet that uses another 
>>>>
>>>>logicsheet before it
>>>>
>>>>
>>>>>is transformed by that other logicsheet.  xsp.xsl is the 
>>>>
>>>>least dependent, most
>>>>
>>>>
>>>>>depended logicsheet.  esql uses it.  
>>>>>
>>>>>Here's the part i'm not sure about:
>>>>>
>>>>>Which ever order they are declared in cocoon.xconf is the 
>>>>
>>>>order you should 
>>>>
>>>>
>>>>>declare your logicsheet in:
>>>>>
>>>>>yourlogicsheet > esql > xsp
>>>>>or 
>>>>>xsp < esql < yourlogicsheet.
>>>>>
>>>>>There was once a time when processing order was determined 
>>>>
>>>>by the order the
>>>>
>>>>
>>>>>namespaces appear on the root element.  I don't think that 
>>>>
>>>>is any longer the
>>>>
>>>>
>>>>>case.
>>>>>
>>>>>Tim
>>>>>
>>>>>On Thu, Jul 17, 2003 at 04:23:38PM +0200, Olivier Billard wrote:
>>>>>
>>>>>
>>>>>
>>>>>>Hi all !
>>>>>>
>>>>>>I've already asked this question on the users list, but the 
>>>>
>>>>dev-ers may be more able to 
>>>>
>>>>
>>>>>>answer... :)
>>>>>>
>>>>>>I would like to know if there is any issue in using tablibs 
>>>>
>>>>from built-in stylesheets 
>>>
>>>>>>(like esql) in user-custom built-in stylesheets.
>>>>>>
>>>>>>For me, no Java code is generated...
>>>>>>Isn't it possible ?
>>>>>>How does Cocoon deal with all these built-in stylesheets ? 
>>>>
>>>>A global stylesheet with 
>>>>
>>>>
>>>>>>"xsl:import" or "xsl:include" ? Is there a requiered order 
>>>>
>>>>of declaration in cocoon.xconf 
>>>>
>>>>
>>>>>>to be able to cross-use taglibs ?
>>>>>>
>>>>>>Thanks in advance !
>>>>>>
>>>>>>-- 
>>>>>>Olivier BILLARD
>>>>
>>>Any e-mail message from the European Central Bank (ECB) is sent in good
>>
>>faith but shall neither be binding nor construed as constituting a commitment
>>by the ECB except where provided for in a written agreement.
>>
>>>This e-mail is intended only for the use of the recipient(s) named above.
>>
>>Any unauthorised disclosure, use or dissemination, either in whole or in
>>part, is prohibited.
>>
>>>If you have received this e-mail in error, please notify the sender
>>
>>immediately via e-mail and delete this e-mail from your system.
>>
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> 
> 

-- 
Olivier BILLARD
Société Jouve
Tel  : 33 2 99 86 93 55
Mail : obillard@rennes.jouve.fr

Le présent mail ainsi que toutes les informations qu'il contient ne peuvent en aucun cas

être considérés comme un engagement juridique de quelque nature que ce soit de JOUVE. Tout

accord devra être formulé par écrit papier ultérieur signé par un représentant légal
de 
JOUVE. Par ailleurs, si vous recevez ce mail par erreur, merci de nous le signaler et de 
le détruire ainsi que l'intégralité du document qui pourrait y être joint.

The present email and all information included therein do not constitute a legal agreement

accorded by Jouve. All legal agreements must be formulated in writing on paper by a legal

representative of JOUVE. If you have received this email by mistake, please inform us of 
that fact and destroy the email and any documents it might contain. Thank you for your 
cooperation.


Mime
View raw message