cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: XPath transformer?
Date Fri, 30 Aug 2002 09:04:47 GMT

Jeff Turner wrote:
> Thanks (Luca too:) for the rapid replies.
> 
> On Fri, Aug 30, 2002 at 10:21:47AM +0200, Koen Pellegrims wrote:
> 
>>What you are trying to do can just as easily be achieved with xslt, can't
>>it?
> 
> 
> Not easily, because the 'match' attribute cannot be dynamic. Eg, I
> couldn't do:
> 
> <xsl:param name="xpath-expr"/>
> 
> <xsl:template match="$xpath-expr">
>   <xsl:copy-of select="."/>
> </xsl:template>

Look at the HTMLGenerator.
Probably you can retrofit the behaviour to the XMLGenerator or to a 
Transformer.

    <map:match pattern="yahoo">
     <map:generate src="http://www.yahoo.com" type="html">
       <map:parameter name="xpath" 
value="/html/body/center/table[4]/tr[1]/td[1]/table[2]/tr[1]/td[1]/center[1]"/>
     </map:generate>
     <map:transform src="stylesheets/news/news.xsl"/>
     <map:serialize type="html"/>
    </map:match>

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message