Re: XPath selector or XPath matcher

2002-08-13 Thread Michael Wechner



Vadim Gritsenko wrote:

From: ROSSEL Olivier [mailto:[EMAIL PROTECTED]]


Is anybody working on a XPath selector or XPath matcher?

 
 These are not possible. Matchers, selectors and actions are processed
 *before* pipeline starts. They are used to *assemble* pipeline, and
 invoked when pipeline is not *completed* yet.
 
 What you can do is to write Transformer to react on XML, and if you use
 full-blown XPath, it will be DOMTransformer -- be prepared to buy more
 memory (it depends on intensity of your site, of course).



Do you mean that I use a pipeline with a transformer to generate a
new request and then call with this new request a resource or another 
pipeline?

In More detail

Original Request:  article2523423.xml

Pipeline with Transfomer (XPath) generates new request: 
article2523423.xml?language=en
(where the XPath might be /article/meta/language)

Resource resp. new another Pipeline matches to language=en
(A resource can't be matched!?)


 
 If you want, you can go through -dev archive, this was discussed
 multiple times.
 
 
 
I have situations where I would like to select the pipeline or
at least the XSLT depending on the value of an attribute within the
generated XML.

If there is no such mecanism in Cocoon, you can code your XSLT

 stylesheets
 
so they make the test by themselves.

 
 That's another option - do the same in XSLT.



That is certainly an option, but I rather not put the matching/selecting
mechanism into the XSLT. But if the approach from above does not work,
then I probably will :-/


Michael


 
 Vadim
 
 
 
 -
 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: [EMAIL PROTECTED]
 For additional commands, e-mail:   [EMAIL PROTECTED]
 



-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




RE: XPath selector or XPath matcher

2002-08-13 Thread Vadim Gritsenko

 From: Michael Wechner [mailto:[EMAIL PROTECTED]]
 
 Vadim Gritsenko wrote:
 
 From: ROSSEL Olivier [mailto:[EMAIL PROTECTED]]
 
 
 Is anybody working on a XPath selector or XPath matcher?
 
  These are not possible. Matchers, selectors and actions are
processed
  *before* pipeline starts. They are used to *assemble* pipeline, and
  invoked when pipeline is not *completed* yet.
 
  What you can do is to write Transformer to react on XML, and if you
use
  full-blown XPath, it will be DOMTransformer -- be prepared to buy
more
  memory (it depends on intensity of your site, of course).
 
 
 Do you mean that I use a pipeline with a transformer to generate a
 new request and then call with this new request a resource or
another
 pipeline?

Include transformers do exactly this.


 In More detail
 
 Original Request:  article2523423.xml
 
 Pipeline with Transfomer (XPath) generates new request:
 article2523423.xml?language=en
 (where the XPath might be /article/meta/language)
 
 Resource resp. new another Pipeline matches to language=en
 (A resource can't be matched!?)

Resource can not be matched, pipeline can be. You can have pipeline
matching article2523423.xml?language=en and your transformer can
include result of this pipeline. Or, your transformer can generate
include tags and then you can have include transformer to process these
tags.

Vadim


  If you want, you can go through -dev archive, this was discussed
  multiple times.
 
 
 
 I have situations where I would like to select the pipeline or
 at least the XSLT depending on the value of an attribute within the
 generated XML.
 
 If there is no such mecanism in Cocoon, you can code your XSLT
 
  stylesheets
 
 so they make the test by themselves.
 
 
  That's another option - do the same in XSLT.
 
 
 
 That is certainly an option, but I rather not put the
matching/selecting
 mechanism into the XSLT. But if the approach from above does not work,
 then I probably will :-/
 
 
 Michael
 
 
 
  Vadim
 
 
 
 
-
  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:
[EMAIL PROTECTED]
  For additional commands, e-mail:
[EMAIL PROTECTED]
 
 
 
 
 -
 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: [EMAIL PROTECTED]
 For additional commands, e-mail:   [EMAIL PROTECTED]


-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




[SUMMARY] Re: XPath selector or XPath matcher

2002-08-13 Thread Michael Wechner



Vadim Gritsenko wrote:

From: Michael Wechner [mailto:[EMAIL PROTECTED]]

Vadim Gritsenko wrote:


From: ROSSEL Olivier [mailto:[EMAIL PROTECTED]]



Is anybody working on a XPath selector or XPath matcher?

These are not possible. Matchers, selectors and actions are

 processed
 
*before* pipeline starts. They are used to *assemble* pipeline, and
invoked when pipeline is not *completed* yet.

What you can do is to write Transformer to react on XML, and if you

 use
 
full-blown XPath, it will be DOMTransformer -- be prepared to buy

 more
 
memory (it depends on intensity of your site, of course).


Do you mean that I use a pipeline with a transformer to generate a
new request and then call with this new request a resource or

 another
 
pipeline?

 
 Include transformers do exactly this.
 
 
 
In More detail

Original Request:  article2523423.xml

Pipeline with Transfomer (XPath) generates new request:
article2523423.xml?language=en
(where the XPath might be /article/meta/language)

Resource resp. new another Pipeline matches to language=en
(A resource can't be matched!?)

 
 Resource can not be matched, pipeline can be. You can have pipeline
 matching article2523423.xml?language=en and your transformer can
 include result of this pipeline. Or, your transformer can generate
 include tags and then you can have include transformer to process these
 tags.



That will work. Thanks a lot

Michael







 
 Vadim
 
 
 
If you want, you can go through -dev archive, this was discussed
multiple times.




I have situations where I would like to select the pipeline or
at least the XSLT depending on the value of an attribute within the
generated XML.


If there is no such mecanism in Cocoon, you can code your XSLT


stylesheets


so they make the test by themselves.


That's another option - do the same in XSLT.



That is certainly an option, but I rather not put the

 matching/selecting
 
mechanism into the XSLT. But if the approach from above does not work,
then I probably will :-/


Michael



Vadim





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

 [EMAIL PROTECTED]
 
For additional commands, e-mail:

 [EMAIL PROTECTED]
 


-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]

 
 
 -
 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: [EMAIL PROTECTED]
 For additional commands, e-mail:   [EMAIL PROTECTED]
 



-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




XPath selector or XPath matcher

2002-08-12 Thread Michael Wechner

Hi

Is anybody working on a XPath selector or XPath matcher?

I have situations where I would like to select the pipeline or
at least the XSLT depending on the value of an attribute within the 
generated XML.

Thanks

Michael


-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




RE: XPath selector or XPath matcher

2002-08-12 Thread ROSSEL Olivier

 Is anybody working on a XPath selector or XPath matcher?
 
 I have situations where I would like to select the pipeline or
 at least the XSLT depending on the value of an attribute within the 
 generated XML.

If there is no such mecanism in Cocoon, you can code your XSLT stylesheets 
so they make the test by themselves.

-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




RE: XPath selector or XPath matcher

2002-08-12 Thread Vadim Gritsenko

 From: ROSSEL Olivier [mailto:[EMAIL PROTECTED]]
 
  Is anybody working on a XPath selector or XPath matcher?

These are not possible. Matchers, selectors and actions are processed
*before* pipeline starts. They are used to *assemble* pipeline, and
invoked when pipeline is not *completed* yet.

What you can do is to write Transformer to react on XML, and if you use
full-blown XPath, it will be DOMTransformer -- be prepared to buy more
memory (it depends on intensity of your site, of course).

If you want, you can go through -dev archive, this was discussed
multiple times.


  I have situations where I would like to select the pipeline or
  at least the XSLT depending on the value of an attribute within the
  generated XML.

 If there is no such mecanism in Cocoon, you can code your XSLT
stylesheets
 so they make the test by themselves.

That's another option - do the same in XSLT.

Vadim



-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




Re: XPath selector or XPath matcher

2002-08-12 Thread Joerg Heinicke

Michael Wechner wrote:
  Hi
 
  Is anybody working on a XPath selector or XPath matcher?
 
  I have situations where I would like to select the pipeline or
  at least the XSLT depending on the value of an attribute within the
  generated XML.
 
  Thanks
 
  Michael



Why don't you use pure XSLT?

An example:

data media=printer
   table
 bla/
   /table
/data

XSLT:

xsl:stylesheet

xsl:import href=printer.xsl/
xsl:import href=pc-browser.xsl/
xsl:import href=pda-browser.xsl/

/xsl:stylesheet

printer.xsl:

xsl:stylesheet

xsl:template match=data[@media='printer']
/xsl:template

xsl:stylesheet

pc-browser.xsl:

xsl:stylesheet

xsl:template match=data[@media='pc']
/xsl:template

xsl:stylesheet


and so on. The rest stays the same.

Regards,

Joerg


-- 

System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
[EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




RE: XPath selector or XPath matcher

2002-08-12 Thread Artur Bialecki


If you want to do it with the current system you
can:
1 - create an action that processes you XSP and stores
  it as DOM on the request, similar to ServerPagesAction
2 - create an action that given XPath will find the
  node/attribute in a stored DOM and return it's value
  as a sitemap parameter.
3 - use the sitemap parameter for your logic.
4 - have a generator that serializes the stored DOM
into sax events, similar to SessionAttributeGenerator.

Artur...

 -Original Message-
 From: Michael Wechner [mailto:[EMAIL PROTECTED]]
 Sent: Monday, August 12, 2002 9:49 AM
 To: [EMAIL PROTECTED]
 Subject: XPath selector or XPath matcher
 
 
 Hi
 
 Is anybody working on a XPath selector or XPath matcher?
 
 I have situations where I would like to select the pipeline or
 at least the XSLT depending on the value of an attribute within the 
 generated XML.
 
 Thanks
 
 Michael
 
 
 -
 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: [EMAIL PROTECTED]
 For additional commands, e-mail:   [EMAIL PROTECTED]
 

-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]