cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: XPath transformer?
Date Fri, 30 Aug 2002 09:01:10 GMT
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>

AFAIK this is for the same reason that Cocoon doesn't currently have an
XPath matcher.

> If you *really* want xpath, you can always write a small xsp-page that
> generates an xinclude-statement and then run it through the
> xinclude-transformer (which, IIRC will be merged with the cinclude
> transformer into a single 'include'-transformer in the near future).

That's a good idea. I'll have a go.

thanks,

--Jeff

> K.
> 
> > -----Oorspronkelijk bericht-----
> > Van: Jeff Turner [mailto:jefft@apache.org]
> > Verzonden: vrijdag 30 augustus 2002 10:25
> > Aan: cocoon-users@xml.apache.org
> > Onderwerp: XPath transformer?
> >
> >
> > Hi,
> >
> > I have a user manual in XML format:
> >
> > <document>
> >   <body>
> >     <s1 title="Introduction">
> >       ...
> >     </s1>
> >     <s1 title="Getting Started">
> >       ...
> >     </s1>
> >     ...
> >   </body>
> > </document>
> >
> > Is there any way that I could extract out just one <s1> element, and
> > render it as a page? Ie, like an XPath transformer, that would extract a
> > single node:
> >
> > <map:match pattern="manual/*">
> >   <map:generate src="manual.xml"/>
> >   <map:transform type="xpath" select="/document/s1[@title='{1}']"/>
> >   <map:transform src="chapter2html.xsl"/>
> > </map:match>
> >
> > I could then link to chapters with <link
> > href="manual/Introduction">introduction</link>.
> >
> > Is this possible, or should I write my own transformer?
> >
> > thanks,
> >
> > --Jeff
> >
> > ---------------------------------------------------------------------
> > 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>
> >
> >
> 
> 
> ---------------------------------------------------------------------
> 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>
> 

-- 
Hell is a state of mind. And every state of mind, left to itself,
every shutting up of the creature within the dungeon of it's own
mind -- is, in the end, Hell.
  C.S. Lewis, _The Great Divorce_

---------------------------------------------------------------------
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