[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Using XML output from Cocoon?

Subject: Using XML output from Cocoon?
From: "Captain N ." <nintendosan@xxxxxxxxx>
Date: Fri, 17 Jun 2005 20:56:59 +0200
cocoon output xml
Hi there,

This is my situation. I have a URI which ends at
"publish/collection:**/file:**/xpath:**". I use cocoon to match on
this pattern.

Collection is the name of the document set. File is the name of the
XML file I want to view, and Xpath is a Xpath Query which points to a
node which I want to be highlighted.

In the match I generate the xml file, and then I want to transform it
with a XSLT file. I want to match a template with the given Xpath
query. But variables in the match attribute are not allowed in XSLT. I
tried using eXSLT, but no luck. It gives me the error "illegal tokens"
(there are position tests in the Xpath query, and I think that's the
problem).

Anyway, I came up with a different idea. I want to preprocess the XSLT
sheet so I'll have a XSLT sheet in which the Xpath query is set from
the beginning, and doesn't have to be calculated on run-time (what
doesn't work). I have made the following code in Cocoon (2.1.7):

<map:pipeline>
 <map:match pattern="publish/collection:**/file:**/xpath:**">
  <map:generate type="file" src="preprocess.xsl"/>
  <map:transform src="preprocessor.xsl">
   <map:parameter name="xpath" value="{3}"/>
  </map:transform>
  <map:serialize type="xml"/>
 </map:match>
</map:pipeline>

This piece of code should output a XSLT sheet which I can use to
transform the XML file. Now my question is: how?! I can not simple put
a generate and a transform elelement after the serialize, cause then I
get an error saying that I have already defined a generator.

I hope somebody can help me. Other suggestions are of course welcome too!

Kind regards, Karel.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.