cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Burton <strangega...@yahoo.com>
Subject RE: XML-Based Selection (Redirect Serializer?)
Date Wed, 27 Feb 2002 12:54:51 GMT
Hi Matthew,

Thanks very much for the suggestion.  It works in
theory (at least I am able to switch to a different
pipe based on different XML from the stream), but has
two problems:

1) If possible, I'd like to keep the mapping from XML
result => new pipeline inside of the sitemap file.

2) I get an error with CInclude "ProcessingException:
Failed to execute pipeline.:
org.apache.cocoon.ProcessingException: Attempted to
process incomplete pipeline" every *alternate* time I
reload the page.  I am using these pipes

 <!-- Generate request XML as the "get-req" pipe -->
 <map:match pattern="get-req" >
   <map:generate type="request" />
   <map:serialize type="xml" />
 </map:match>

 <!-- Include "get-req" into an XML file -->    
 <map:match pattern="cinclude-test" >
   <map:generate src="a.xml" />
   <map:transform type="cinclude" />
   <map:serialize type="xml" />
 </map:match>

With this data for "a.xml":

<?xml version="1.0" encoding="UTF-8"?>
<page
xmlns:cinclude="http://apache.org/cocoon/include/1.0">
  <title>Hello</title>
  <content>
    <para>This will test cinclude</para>
    <cinclude:include src="cocoon:/get-req"
                      element="included"/>
  </content>
</page>

Could this be some sort of multithreading error causes
by CInclude not being used to "cocoon:/"-type URLs?

So here is my next question: it looks like the core
lines in the CIncludeTransformer are these:

    source = this.sourceResolver.resolve(src);
    source.toSAX(consumer);

Does this mean that all it would take to generate a
SAX stream from the pipeline "foo" would be to execute
the code

  this.sourceResolver.resolve("cocoon://foo");
  source.toSAX(...)

And how does that work if the pipe invoked returns
non-XML content?  Actually, it seems easier if someone
could tell me the code for invoking and outputting an
arbitrary Cocoon URI (so I could make the custom
serializer), but I have no idea how to do that.

Thanks,
Jim

--- Matthew Langham <mlangham@s-und-n.de> wrote:
> Hi James,
> 
> one solution that may help:
> 
> Your Transformer -> Stylesheet ->
> CIncludeTransformer -> serializer
> 							:
>  							v
> 						pipeline (via: "cocoon://...")
> 
> So the stylesheet constructs the URI from the data
> your transformer sends.
> 
> Matthew


__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message