Action - DatabaseSelectAction and XSP + ESQL
Hi Guys Between Action - DatabaseSelectAction and XSP + ESQL Which is better? Which is easier to code? How am I suppose to get the results on the Action - DatabaseSelectAction? Thanks Richard
Re: Action - DatabaseSelectAction and XSP + ESQL
On 31.Jul.2002 -- 03:48 PM, Richard wrote: Hi Guys Between Action - DatabaseSelectAction and XSP + ESQL Which is better? They target different use cases. To output the values, esql is easier and leaner. You might want to consider the SQLTransformer as well. If you use XSP, I would still recommend esql. If XSP is not needed, the transformer approach is 'better'. Action + transformer is also possible, but IMO unecessarily complex. Which is easier to code? Since you would need to code the output in XSP anyways, esql. How am I suppose to get the results on the Action - DatabaseSelectAction? They are stored in request attributes (see javadocs / docs for names). Chris. -- C h r i s t i a n H a u l [EMAIL PROTECTED] fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08 - 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: Action - DatabaseSelectAction and XSP + ESQL
Thanks. - Original Message - From: Christian Haul [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Richard [EMAIL PROTECTED] Sent: Wednesday, July 31, 2002 4:00 PM Subject: Re: Action - DatabaseSelectAction and XSP + ESQL On 31.Jul.2002 -- 03:48 PM, Richard wrote: Hi Guys Between Action - DatabaseSelectAction and XSP + ESQL Which is better? They target different use cases. To output the values, esql is easier and leaner. You might want to consider the SQLTransformer as well. If you use XSP, I would still recommend esql. If XSP is not needed, the transformer approach is 'better'. Action + transformer is also possible, but IMO unecessarily complex. Which is easier to code? Since you would need to code the output in XSP anyways, esql. How am I suppose to get the results on the Action - DatabaseSelectAction? They are stored in request attributes (see javadocs / docs for names). Chris. -- C h r i s t i a n H a u l [EMAIL PROTECTED] fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08 - 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: pb with http request
OK thanks! It was because of spurious whitespaces before the xml declaration. It runs well now...;-) Cyril. - Original Message - From: Joerg Heinicke [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 31, 2002 3:15 AM Subject: Re: pb with http request This has nothing to do with the example, it's a common error message, when having the Xril.ML declaration not as the absolutely first thing in the XML file. There must not be any whitespaces or other characters in front of the XML declaration and it has to be in the form as at http://www.w3.org/TR/REC-xml#sec-prolog-dtd. Watch for case-sensitivity too. Have a look in all the related files to fix the bug. cyril vidal wrote: Hy, I just was trying to run the example wrotten by Steve Punk in Getting started with Cocoon 2 http://www.xml.com/lpt/a/2002/07/10/cocoon2.html More precisely, the last example that calculates a factorial from a numeric value submitted via HTTP POST. Here's the sitemap: map:sitemap xmlns:map=http://apache.org/cocoon/sitemap/1.0; snip/ /map:sitemap and here's the file mystylesheet.xsl that I've copied in integrality from the original source: ?xml version=1.0? This one seems to be ok, but I can't see whether there are any whitespaces in the file of course. !-- Author: Steven P. Punte [EMAIL PROTECTED] -- !-- Description: Computes Factorial -- xsl:stylesheet version=1.0 snip/ /xsl:stylesheet When I run this by pointing my browser to http://localhost/mypage?input=5 I receive the following error message: *description* _org.apache.cocoon.ProcessingException: Exception in creating Transform Handler: org.xml.sax.SAXParseException: The XML declaration may only appear at the very beginning of the document._ _I _don't understand why this occurs. Can you help me please? Thanks in advance, Cyril Vidal Email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Web: http://www.planetexml.com Regards, Joerg - 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: esql - oracle stored procedure returns resultset
- Original Message - From: Christian Haul [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 30, 2002 7:42 PM Subject: Re: esql - oracle stored procedure returns resultset I'm certain that others do use oracle sps the way described. Actually, the esql sp support started that way... it would be nice, if other oracle sp users can confirm this and even better send a small example how they do it. thanks in advance Frank Taffelt - 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]
R: Multiple map:resource calls
Hi Vadim, I tried several possibilities, and I found a few points regarding my webapp (I'm sure they're not C2 issues:-)): 1) A resource which contains no serializer stops the pipeline, returning no output. Such a sitemap fragment: [...] map:resource name=crea-form-dati map:transform src=_xsl/data0.xsl/ map:transform src=_xsl/data.xsl/ /map:resource [...] map:call resource=crea-form-dati/ map:serialize/ [...] simply returns me a 404. If I add a map:serialize/ at the end of the resource, it returns output again. The problem is that the serializer, as you reminded me, really prevents any further processing. So it seems like: a) A resource needs a serializer; b) A serializer prevents any further processing; = In any matcher there can be only one map:call resource=xxx/, and it must be the last stage of the processing. I'm sure I'm wrong. :-) But please help me find why! 2) Temporary work-around could be: map:match pattern=data/* map:match pattern=* map:call resource=crea-form-dati/ /map:match map:match pattern=* map:call resource=aspetto-finale/ /map:match map:serialize/ /map:match Just for curiosity, I tried the suggested workaround, but without the map:call resource=xxx/ (which, as said, stops further processing). I found that the nested matchers are not evaluated in the context of their father, but in the same context: that is, the nested map:match pattern=* must be changed to map:match pattern=data/*. A working example is: map:match pattern=data/* [...] map:match pattern=data/* map:transform src=_xsl/data0.xsl/ map:transform src=_xsl/data.xsl/ /map:match map:match pattern=data/* map:transform src=_xsl/style.xsl/ /map:match [...] /map:match Thanks, L. -Messaggio originale- Da: Vadim Gritsenko [mailto:[EMAIL PROTECTED]] Inviato: martedì 30 luglio 2002 14.46 A: [EMAIL PROTECTED] Oggetto: RE: Multiple map:resource calls From: Lorenzo De Sio [mailto:[EMAIL PROTECTED]] Hi all, it seems to me like it is not possible to perform multiple map:call resource=xxx/ calls in a single matcher. Fragments from my sitemap: [...] map:resources map:resource name=aspetto-finale map:transform src=_xsl/style.xsl map:parameter name=nome value={nome}/ map:parameter name=cognome value={cognome}/ map:parameter name=doc_name value={../1}/ /map:transform map:serialize/ /map:resource map:resource name=crea-form-dati map:transform src=_xsl/data0.xsl/ map:transform src=_xsl/data.xsl/ map:serialize/ /map:resource /map:resources [...] map:match pattern=data/* [...] map:call resource=crea-form-dati/ BTW, this (second call to resource) will never be executed because of map:serialize/ in first call to resource): map:call resource=aspetto-finale/ map:serialize/ /map:act /map:match [...] Both resources work, if used only one at a time. But, as soon as I try to use both of them in a single matcher, I get the following exception: duplicate definition of variable methodName in method matchN10092 [...] duplicate definition of variable argTypes in method matchN10092 [...] duplicate definition of variable argValues in method matchN10092 [...] which is obvious, if we look at the generated sitemap.java: map = new HashMap(1); String methodName = resource_ + substitute(listOfMaps, crea_form_dati); listOfMaps.add(map); this.dumpParameters(listOfMaps); Class[] argTypes = new Class[] {StreamPipeline.class, EventPipeline.class, List.class, Environment.class, String.class, Boolean.TYPE}; Object[] argValues = new Object[] {pipeline, eventPipeline, listOfMaps, environment, cocoon_view, new Boolean(internalRequest)}; if (true) return invokeMethod(methodName, argTypes, argValues); map = new HashMap(1); String methodName = resource_ + substitute(listOfMaps, aspetto_finale); listOfMaps.add(map); this.dumpParameters(listOfMaps); Class[] argTypes = new Class[] {StreamPipeline.class, EventPipeline.class, List.class, Environment.class, String.class, Boolean.TYPE}; Object[] argValues = new Object[] {pipeline, eventPipeline, listOfMaps, environment, cocoon_view, new Boolean(internalRequest)}; if (true) return invokeMethod(methodName, argTypes, argValues); Any hints? Am I doing wrong in trying to call two resources in a matcher? Are there any correct alternatives? Congratulations, you found a bug! Temporary work-around could be: map:match pattern=data/* map:match pattern=* map:call resource=crea-form-dati/
support non-english characters in HTML serializer
Hi all! Can anyone help me with following problem: I place russian text into attributes in my tags (for example: a href=ÔÅÓÔ/). And I see unicode encoding text in the attribute in output HTML :( Any way for solve this problem? Thanx. Yury. - 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: esql - oracle stored procedure returns resultset
Frank, just for the record: I use SQLTransformer, which runs smoothly even with multiple cursors returned by SPs. I used this method for a couple of projects and for some dozens SPs... not a glitch. Best regards, - Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html - -Original Message- From: Frank Taffelt [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 31, 2002 11:12 AM To: [EMAIL PROTECTED] Subject: Re: esql - oracle stored procedure returns resultset - Original Message - From: Christian Haul [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 30, 2002 7:42 PM Subject: Re: esql - oracle stored procedure returns resultset I'm certain that others do use oracle sps the way described. Actually, the esql sp support started that way... it would be nice, if other oracle sp users can confirm this and even better send a small example how they do it. thanks in advance Frank Taffelt - 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]
LinkSerializer not seeing links (href, src)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I have a second problem with LinkSerializer. Sometimes I can only see href's (no src), sometimes I can't see any links. The cocoon examples work without problems. The xhtml output validates against the DTD. If this helps you, DOCTYPE isn't in the output of my xhtml (don't know why). Oh yes, tested with cocoon 2.0.3 and cvs-version. With kind regards Torsten Knodt -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9R6/HvxZktkzSmiwRAoHoAJ97JjeyPY0mLjHNDs8qrCv6zP5IywCfVyOb 0XtaVCzjHhQ8FlhtJbnuk04= =Hy4i -END PGP SIGNATURE- - 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]
xalan and request generator
Since the root of the document returned by map:generate type=request/ contains xmlns declaration, my xpath query against this document does not work. Using xalan 2.3.1. Any workaround ? or would need to have another stylesheet to move xmlns declaration ? ?xml version=1.0 encoding=UTF-8? request xmlns=http://xml.apache.org/cocoon/requestgenerator/2.0; target=/baepp/getcheckedplugs source= requestHeaders Thanks Barbara - 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]
New sunBow Preview
The newest preview version of our Cocoon IDE plugin for eclipse - sunBow - is now available. More information here: http://radio.weblogs.com/0108489/2002/07/31.html#a6 Matthew -- Open Source Group Cocoon { Consulting, Training, Projects } = Matthew Langham, SN AG, Klingenderstrasse 5, D-33100 Paderborn Tel:+49-5251-1581-30 [EMAIL PROTECTED] - http://www.s-und-n.de - Cocoon book: http://www.amazon.com/exec/obidos/ASIN/0735712352/needacake-20 = - 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 : xalan and request generator
OK I have the solution : in the xsl declare rg namespace as http://xml.apache.org/cocoon/requestgenerator/2.0 and then prefix every element in xpath queries by it... Learned something ! Barbara - Original Message - From: Barbara Post [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 31, 2002 11:41 AM Subject: xalan and request generator Since the root of the document returned by map:generate type=request/ contains xmlns declaration, my xpath query against this document does not work. Using xalan 2.3.1. Any workaround ? or would need to have another stylesheet to move xmlns declaration ? ?xml version=1.0 encoding=UTF-8? request xmlns=http://xml.apache.org/cocoon/requestgenerator/2.0; target=/baepp/getcheckedplugs source= requestHeaders Thanks Barbara - 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]
AW: multiple checkboxes and request parameters passed to an xsl
Hi Barbara, I already spent a couple of time about this problem and found the following, suboptimal solution: I created an XSP, called the xsp-request:get-parameter-values name=foo/ and filled all the parameter name/value pairs in a loop into an XML element. Then I used the aggregate tag in the sitemap to concatenate the xml stream generated by the XSP (which contains now the parameter name/value pairs) with the original one. So I was at least able to reuse my stylesheet and additionally to get my parameter values out of the XML stream. Regards, Elmar -Ursprüngliche Nachricht- Von: Barbara Post [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 31. Juli 2002 00:05 An: [EMAIL PROTECTED]; [EMAIL PROTECTED] Betreff: Re: multiple checkboxes and request parameters passed to an xsl hello Christian,, I don't want to use xsp, only xsl so... Babs -- website: www.babsfrance.fr.st ICQ #: 135868405 - Original Message - From: Christian Haul [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 30, 2002 7:45 PM Subject: Re: multiple checkboxes and request parameters passed to an xsl On 30.Jul.2002 -- 07:15 PM, Barbara Post wrote: Hello, how can my stylesheet get all the http request parameters since the http request sends a variable number of parameters named checkedbox_i for example, i being an unique identifier ? checkboxes are in variable number on the submit page, depending on a former choice. Have a look at the getParameterValues() method (or xsp-request:get-parameter-values name=foo/). They return arrays containing all values. Chris. -- C h r i s t i a n H a u l [EMAIL PROTECTED] fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08 - 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]
creating new file with SWT
Hi all, I am trying to get the SourceWritingTransformer to create a new XML file. Is this possible at all? All the samples I find write to existing files. The portal is the only sample that writes new files, but it's using session:target to create the new files. Anyway, here's my code snip page source:write source:sourcedocs/xsl:value-of select=$dir//my.xml/source:source source:fragmentpage titlenew page/title descriptiondescription of new page/description contentEnter your content here/content /page/source:fragment /source:write /page And the pipeline that manages it map:generate type=request/ map:transform src=admin/styles/new-page.xsl map:parameter name=use-request-parameters value=true/ map:parameter name=dir value={1}/ /map:transform map:transform type=write-source/ map:serialize type=xml/ I'm using CVS HEAD from May 15th. Should I update? Any help is welcome! Bert - Please notify me if you did not receive this mail. - 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: multiple checkboxes and request parameters passed to an xsl
Hi Elmar, I found a close solution : use request generator to get all the parameters, then apply an xsl to get only the family of parameters I want (name starting with a special word) then I can use the resulting xml by aggregation too.. Thanks Babs - Original Message - From: Sternath Elmar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 31, 2002 11:56 AM Subject: AW: multiple checkboxes and request parameters passed to an xsl Hi Barbara, I already spent a couple of time about this problem and found the following, suboptimal solution: I created an XSP, called the xsp-request:get-parameter-values name=foo/ and filled all the parameter name/value pairs in a loop into an XML element. Then I used the aggregate tag in the sitemap to concatenate the xml stream generated by the XSP (which contains now the parameter name/value pairs) with the original one. So I was at least able to reuse my stylesheet and additionally to get my parameter values out of the XML stream. Regards, Elmar -Ursprüngliche Nachricht- Von: Barbara Post [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 31. Juli 2002 00:05 An: [EMAIL PROTECTED]; [EMAIL PROTECTED] Betreff: Re: multiple checkboxes and request parameters passed to an xsl hello Christian,, I don't want to use xsp, only xsl so... Babs -- website: www.babsfrance.fr.st ICQ #: 135868405 - Original Message - From: Christian Haul [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 30, 2002 7:45 PM Subject: Re: multiple checkboxes and request parameters passed to an xsl On 30.Jul.2002 -- 07:15 PM, Barbara Post wrote: Hello, how can my stylesheet get all the http request parameters since the http request sends a variable number of parameters named checkedbox_i for example, i being an unique identifier ? checkboxes are in variable number on the submit page, depending on a former choice. Have a look at the getParameterValues() method (or xsp-request:get-parameter-values name=foo/). They return arrays containing all values. Chris. -- C h r i s t i a n H a u l [EMAIL PROTECTED] fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08 - 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]
Controlling the flow based on users role
Hi, Is there a way to protect resources in a way that only certain roles have access to them? Already tried Session Selector, but I wasn't able to access the session context that the auth-login action creates. I'd also like to know if it's possible for a user to have multiple roles defined (for example user could be an dbAdmin and user) Ideas? -Tuomo - 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]
[docs] Installation on resin 2.1.1 (was R: resin 2.1.x problems)
Robert, it worked perfectly on a fresh Resin installation. Since it's by far much easier and cleaner than the procedure for previous versions, I suggest it be added to the documentation. How can we achieve this? L. -Messaggio originale- Da: Robert S. Koberg [mailto:[EMAIL PROTECTED]] Inviato: lunedì 29 luglio 2002 12.12 A: [EMAIL PROTECTED] Oggetto: Re: resin 2.1.x problems Hi, Lorenzo De Sio wrote: I just tried the following procedure (found on this list) to solve my problem w/Resin 2.1.1. It worked. What about adding it to the installation docs? L. Another thing you can do in the RESIN_HOME/conf/resin.conf is: !-- - If true, the classloader order follows the Servlet spec. - If false, the classloader order follows the JDK spec. -- servlet-classloader-hacktrue/servlet-classloader-hack when set to true it goes to your WEB-INF/lib best, -Rob List: xml-cocoon-users Subject: Solution for Problem with Resin 2.1.x and Cocoon 2.0.x From: =?iso-8859-1?Q?J=F6rn_Heid?= [EMAIL PROTECTED] Date: 2002-05-01 12:11:05 For all who will have problems with Resin 2.1.x running Cocoon 2.0.x and JDK 1.4. Symptom: After deleting dom.jar, sax.jar and jaxp.jar (the TODO for Resin 2.0.x), and putting all required JARs to resin/lib I got a NoSuchMethodError as the Resin-XSLT implementation was used instead of Xalan. java.lang.NoSuchMethodError: javax.xml.transform.TransformerException: method init()V not found at com.caucho.xsl.XslException.init(XslException.java:59) Changing xalan-xxx.jar to a_xalan-xxx.jar does not succeed. Solution: Remove all entries in WEB-INF/services from resin.jar (you can change the filename to resin.zip, delete those entries, and change the filename back again). JOERN - 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]
RE: using request selector to choose xsl
thanks so much for explaining! I had not understood that the serialise would always terminate the sitemap processing. At 9:49 AM -0400 30/7/02, Vadim Gritsenko wrote: From: Jo Bourne [mailto:[EMAIL PROTECTED]] Hi Vadim, I am confused by your example, the way it reads to me the default xsl will always run, even if the special one is detected and run first? You have not interpreted sitemap correctly. map:match pattern=**.xml map:generate src={1}.xml/ Add generator. !-- Here: request corresponds to RequestParameterMatcher -- Is style request parameter present? map:match type=request pattern=style Yes: map:transform src={1}.xsl/ Add transformer. map:serialize ... / Add serializer and **stop** sitemap processing. /map:match No: map:transform src=default.xsl/ Add transformer. map:serialize ... / Add serializer and **stop** sitemap processing. /map:match PS See lint.xmap, it will open your eyes. Vadim thanks Jo At 9:18 AM -0400 30/7/02, Vadim Gritsenko wrote: From: Barbara Post [mailto:[EMAIL PROTECTED]] Hello, is this ok for your problem ? But if style is not specified this wouldn't be ok. So you would have to specify a default value anyway when submitting... Edited version: map:match pattern=**.xml map:generate src={1}.xml/ !-- Here: request corresponds to RequestParameterMatcher -- map:match type=request pattern=style map:transform src={1}.xsl/ map:serialize ... / /map:match map:transform src=default.xsl/ map:serialize ... / /map:match 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] -- Jo Bourne Virtual Artists Pty Ltd - 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: Error handling in xsp:element...
From: Per Kreipke [mailto:[EMAIL PROTECTED]] If I do the following in an XSP, the CInclude transformer doesn't recognize the cinclude:include element because it has no namespace associated with it. xsp:element name=cinclude:include This is incorrect. Of course. I thought it might take it from the a parent XSP element but it doesn't. xsp:attribute name=srcxsp:exprstrURL/xsp:expr/xsp:attribute /xsp:element I had to change it to be: xsp:element name=cinclude:include prefix=cinclude uri=http://apache.org/cocoon/include/1.0; This is also not ok. Should be: xsp:element name=include prefix=cinclude uri=http://apache.org/cocoon/include/1.0; Yep, you're right of course, copy/paste sloppiness. xsp:attribute name=srcxsp:exprstrURL/xsp:expr/xsp:attribute /xsp:element In the second example, the condition where I forget to include both @prefix and @uri, I get an error. But in the first example, there's no error even though cinclude:include is an invalid XML element name without a namespace. xsp.xsl would need an extra check. It will not be efficient to do this, because this check must be made at run time, and every time. I guess you have not considered that this is possible: Forgot to add @name: xsp:element prefix=cinclude uri=http://apache.org/cocoon/include/1.0; xsp:param name=namexsp:logicincl + ude/xsp:logic/xsp:param /xsp:element [aside: is xsp:param a real thing?] Now it's real. I see you're point. But I'm willing to let that case go for efficiency as long as we protect the beginner from naiive mistakes like name=cinclude:include. Just testing for ':' within @name would help prevent highlight their error instead of doing nothing at all. Ok. It turns out that the CIncludeTransformer (correctly) skips the element completely (because the namespace URI isn't applied to the element) but when you examine the XML, it's not at all apparent, especially if you've added the cinclude namespace at the top. Instead, the cinclude:include element continues to appear in the output, no matter what you do to the sitemap, mistakenly thinking that the transformer isn't being executed. :) Vadim Per - 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]
advice on a simple architecture for xml versioning
Hi all, I need advice on the various options available for building a simple versioning system for xml files. I went through the list archives looking for pointers, but I did not find much (apart from some very interesting, but old, conversation about cms implementation issues). Very briefly, the issue is as follow. I have succesfully implemented a very satisfying solution for client-side editing of xml files. The edited files are saved on the server (as separate files with a timestamp in the filename) by means of source write transformations. The next logical step would be to process these files automatically in order to produce sort of diff files to be used to present to the client various view of the edited content. The user's scenario is an editorial review process. My research on the subject led me to the following (not much, I admit): 1. It does exist an XMLDiff utility (see www.vmguys.com), but it needs JDOM. Is anyone using it in a C2 environment ? Does exist some other alternative in the xml.apache realm ? 2. some vague hints on using XIndice as a back-end for an xml versioning system (forgive me if I am wrong). 3. I have the impression that a CVS like system could be an option, but I don't know the details of the system, so I cannot tell for sure and I am not able to evaluate the implications of using it as a xml document based (vs. a code based) versioning system. I think that a server side xml versioning tool for documents is something getting hotter and hotter now that browser based xml editors are maturing and the option of let non-technical people edit trasparently xml files is becoming a reality. I am sure that quite a lot of people on this list has already done some thinking on the subject, so I am asking to share any findings. I am realively new to this list, so forgive me if I am opening again an old thread. Thanks in advance for any reply, --peppo - 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]
Redirecting
Hello, I have two question and hope somebody can help me: 1.) Are there any examples how to redirect with an Action that inherits from AbstractXMLFormAction - how do I get the Redirector there - if this is the right object to redirect? 2.) How do I access the init-parameters of my web.xml in an action. I tried: HttpContext context = (HttpContext)ObjectModelHelper.getContext(objectModel); and objectModel.get(httpservletcontext); but that did not work. Thanks in advance for any help, miHam - 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: xalan and request generator
From: Barbara Post [mailto:[EMAIL PROTECTED]] Since the root of the document returned by map:generate type=request/ contains xmlns declaration, my xpath query against this document does not work. Using xalan 2.3.1. Any workaround ? or would need to have another stylesheet to move xmlns declaration ? You would have to fix your xpath query, it must contain error. Vadim ?xml version=1.0 encoding=UTF-8? request xmlns=http://xml.apache.org/cocoon/requestgenerator/2.0; target=/baepp/getcheckedplugs source= requestHeaders Thanks Barbara - 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: LinkSerializer not seeing links (href, src)
From: Torsten Knodt [mailto:[EMAIL PROTECTED]] -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I have a second problem with LinkSerializer. Sometimes I can only see href's (no src), Give an example (reproducible). sometimes I can't see any links. Same here. Vadim The cocoon examples work without problems. The xhtml output validates against the DTD. If this helps you, DOCTYPE isn't in the output of my xhtml (don't know why). Oh yes, tested with cocoon 2.0.3 and cvs-version. With kind regards Torsten Knodt - 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]
xsp problem
hy, In the last message, I've asked a question about a small factorial program, dynamically written with a recursive XSLT named-template call and getting a parameter via HTTP request. xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:http="http://xml.apache.org/cocoon/requestgenerator/2.0" xsl:template match="/" page valeur-parametre xsl:value-of select="/http:request/http:requestParameters/ http:parameter/http:value"/ /valeur-parametre calcul-factoriel xsl:call-template name="factorial" xsl:with-param name="input" select="/http:request/ http:requestParameters/http:parameter/http:value"/ /xsl:call-template /calcul-factoriel /page /xsl:template xsl:template name="factorial" xsl:param name="input"/ xsl:choose xsl:when test="$input 1" xsl:variable name="tmp" xsl:call-template name="factorial" xsl:with-param name="input" select="$input - 1" / /xsl:call-template /xsl:variable xsl:value-of select="$tmp * $input"/ /xsl:when xsl:otherwise 1 /xsl:otherwise /xsl:choose /xsl:template /xsl:stylesheet Now, for training, I just would like to do the same with XSP. So, instead of the recursive call to the xsl template name, I'de like to use a Java method: This onemight bethe following: public static int factorialize (int input){ int result; if (inputgt;1) { result=factorialize(input-1); } else{ result=1; } return input*result;} Problem, I'm new to XSP and I don't know exactly how to do. Iknow I have to embeed this code in a xsp:logic element, and get the result with a xsp:expr but I ignore the correct syntax. Can you give me some advice? Thanks, Cyril VidalEmail: [EMAIL PROTECTED]Web: http://www.planetexml.com
RE: Multiple map:resource calls
From: Lorenzo De Sio [mailto:[EMAIL PROTECTED]] Hi Vadim, I tried several possibilities, and I found a few points regarding my webapp (I'm sure they're not C2 issues:-)): ... So it seems like: a) A resource needs a serializer; Yes, I looked into the code and I can confirm this. At least, in its current implementation, resource needs serializer. b) A serializer prevents any further processing; Yep. = In any matcher there can be only one map:call resource=xxx/, and it must be the last stage of the processing. As of now, yep. I'm sure I'm wrong. :-) But please help me find why! 2) Temporary work-around could be: map:match pattern=data/* map:match pattern=* map:call resource=crea-form-dati/ /map:match map:match pattern=* map:call resource=aspetto-finale/ /map:match map:serialize/ /map:match Just for curiosity, I tried the suggested workaround, but without the map:call resource=xxx/ (which, as said, stops further processing). I found that the nested matchers are not evaluated in the context of their father, but in the same context: In this sense, yep. Matchers do not change environment. that is, the nested map:match pattern=* must be changed to map:match pattern=data/*. Consider it typo on my part: I meant **. Unless, of course, instead of {../1} you still want to use {1} - then data/* will be better. A working example is: map:match pattern=data/* [...] map:match pattern=data/* map:transform src=_xsl/data0.xsl/ map:transform src=_xsl/data.xsl/ /map:match map:match pattern=data/* map:transform src=_xsl/style.xsl/ /map:match [...] /map:match Thanks, L. ... - 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]
xsl and http request header
Hello, can an xsl directly access http request header (like http request parameters) or should I use request generator ? I want a text field to have a size specified by the kind of browser... Maybe rather use browser selector to pass a parameter to my xsl...? Babs - 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: Redirecting
From: [EMAIL PROTECTED] Hello, I have two question and hope somebody can help me: 1.) Are there any examples how to redirect with an Action that inherits from AbstractXMLFormAction - how do I get the Redirector there - if this is the right object to redirect? getRedirector() 2.) How do I access the init-parameters of my web.xml in an action. I tried: HttpContext context = (HttpContext)ObjectModelHelper.getContext(objectModel); Context context = ObjectModelHelper.getContext(objectModel); Vadim and objectModel.get(httpservletcontext); but that did not work. Thanks in advance for any help, miHam - 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: xsl and http request header
I think that you can do that using a xsl document() pointing to a cocoon url with http generator and xml serializer. This is a VERY powerful option of Cocoon. -Message d'origine- De: Barbara Post [mailto:[EMAIL PROTECTED]] Date: mercredi 31 juillet 2002 15:51 À: [EMAIL PROTECTED] Objet: xsl and http request header Hello, can an xsl directly access http request header (like http request parameters) or should I use request generator ? I want a text field to have a size specified by the kind of browser... Maybe rather use browser selector to pass a parameter to my xsl...? Babs - 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: xsl and http request header
Thank you, it does work : xsl:when test=document('cocoon://httprequest')/rg:request/rg:requestHeaders/rg:heade r[@name='user-agent' and contains(., 'MSIE')]80/xsl:when - Original Message - From: ROSSEL Olivier [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 31, 2002 3:56 PM Subject: RE: xsl and http request header I think that you can do that using a xsl document() pointing to a cocoon url with http generator and xml serializer. This is a VERY powerful option of Cocoon. -Message d'origine- De: Barbara Post [mailto:[EMAIL PROTECTED]] Date: mercredi 31 juillet 2002 15:51 À: [EMAIL PROTECTED] Objet: xsl and http request header Hello, can an xsl directly access http request header (like http request parameters) or should I use request generator ? I want a text field to have a size specified by the kind of browser... Maybe rather use browser selector to pass a parameter to my xsl...? Babs - 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]
R: Multiple map:resource calls
OK :-)) -Messaggio originale- Da: Vadim Gritsenko [mailto:[EMAIL PROTECTED]] Inviato: mercoledì 31 luglio 2002 15.45 A: [EMAIL PROTECTED] Oggetto: RE: Multiple map:resource calls From: Lorenzo De Sio [mailto:[EMAIL PROTECTED]] Hi Vadim, I tried several possibilities, and I found a few points regarding my webapp (I'm sure they're not C2 issues:-)): ... So it seems like: a) A resource needs a serializer; Yes, I looked into the code and I can confirm this. At least, in its current implementation, resource needs serializer. b) A serializer prevents any further processing; Yep. = In any matcher there can be only one map:call resource=xxx/, and it must be the last stage of the processing. As of now, yep. I'm sure I'm wrong. :-) But please help me find why! 2) Temporary work-around could be: map:match pattern=data/* map:match pattern=* map:call resource=crea-form-dati/ /map:match map:match pattern=* map:call resource=aspetto-finale/ /map:match map:serialize/ /map:match Just for curiosity, I tried the suggested workaround, but without the map:call resource=xxx/ (which, as said, stops further processing). I found that the nested matchers are not evaluated in the context of their father, but in the same context: In this sense, yep. Matchers do not change environment. that is, the nested map:match pattern=* must be changed to map:match pattern=data/*. Consider it typo on my part: I meant **. Unless, of course, instead of {../1} you still want to use {1} - then data/* will be better. A working example is: map:match pattern=data/* [...] map:match pattern=data/* map:transform src=_xsl/data0.xsl/ map:transform src=_xsl/data.xsl/ /map:match map:match pattern=data/* map:transform src=_xsl/style.xsl/ /map:match [...] /map:match Thanks, L. ... - 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]
Antwort: RE: Redirecting
Hello, I already tried Context context = ObjectModelHelper.getContext(objectModel); String param = context.getInitParameter(param_one); but also there my String is null. Is there another way? Thanx again for any help, miHam - 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: [docs] Installation on resin 2.1.1 (was R: resin 2.1.x problems)
From: Lorenzo De Sio [mailto:[EMAIL PROTECTED]] Robert, it worked perfectly on a fresh Resin installation. You mean no modifications to resin? No, it does not work. Have you tried http://localhost:8080/cocoon/xscript/soap-getquote1 sample? However, servlet-classloader-hacktrue/servlet-classloader-hack Helps (have not tested all the samples though) Vadim Since it's by far much easier and cleaner than the procedure for previous versions, I suggest it be added to the documentation. How can we achieve this? L. -Messaggio originale- Da: Robert S. Koberg [mailto:[EMAIL PROTECTED]] Inviato: lunedì 29 luglio 2002 12.12 A: [EMAIL PROTECTED] Oggetto: Re: resin 2.1.x problems Hi, Lorenzo De Sio wrote: I just tried the following procedure (found on this list) to solve my problem w/Resin 2.1.1. It worked. What about adding it to the installation docs? L. Another thing you can do in the RESIN_HOME/conf/resin.conf is: !-- - If true, the classloader order follows the Servlet spec. - If false, the classloader order follows the JDK spec. -- servlet-classloader-hacktrue/servlet-classloader-hack when set to true it goes to your WEB-INF/lib best, -Rob ... - 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: esql - oracle stored procedure returns resultset
- Original Message - From: Luca Morandini [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 31, 2002 11:36 AM Subject: RE: esql - oracle stored procedure returns resultset just for the record: I use SQLTransformer, which runs smoothly even with multiple cursors returned by SPs. I used this method for a couple of projects and for some dozens SPs... not a glitch. thanks, tried it out . works quit well. Christian, i'm pretty sure that the current esql is not able to run oracle sp in that way. It would be possible if i could write something like that: esql:parameter direction=out type=oracle.jdbc.driver.OracleTypes.CURSOR/ The esql:parameter is restricted to java.sql.Type Frank - 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: advice on a simple architecture for xml versioning
On Wednesday 31 July 2002 14:51, Giuseppe Bonelli wrote: . . . 3. I have the impression that a CVS like system could be an option, but I don't know the details of the system, so I cannot tell for sure and I am not able to evaluate the implications of using it as a xml document based (vs. a code based) versioning system. . . . Integrating CVS as a storage back-end for Cocoon (WriteableSource?) would be great and would certainly work for XML too, but the diffs will not be very usable IMHO. CVS diffs are line-oriented, not element-oriented, which might make it very hard to display the diffs in a meaningful way to the user. -Bertrand - 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: LinkSerializer not seeing links (href, src)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Vadim, I have a second problem with LinkSerializer. Sometimes I can only see href's (no src), Give an example (reproducible). sometimes I can't see any links. Same here. I wasn't able to reproduce the version, where only href's where recognised, but here's a version, which doesn't produce any links. It's stripped down as much as possible. When it would work, you should see a broken link to test2.html. The error xsl isn't included, it's the sample. With kind regards Torsten Knodt -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9SAolvxZktkzSmiwRAndYAJ0SgE1mV0heRoaups9ovf3WJrhaVACggrs6 3DDSqIDMr/NU7e38YnQCCQg= =EMJZ -END PGP SIGNATURE- ?xml version=1.0 encoding=utf-8? map:sitemap xmlns:map=http://apache.org/cocoon/sitemap/1.0; map:components map:generators default=file map:generator label=content,data logger=sitemap.generator.file name=file pool-grow=4 pool-max=32 pool-min=8 src=org.apache.cocoon.generation.FileGenerator / /map:generators map:transformers default=xslt map:transformer logger=sitemap.transformer.xsltc name=xslt pool-grow=2 pool-max=32 pool-min=8 src=org.apache.cocoon.transformation.TraxTransformer use-request-parameterstrue/use-request-parameters use-browser-capabilities-dbtrue/use-browser-capabilities-db use-delitrue/use-deli /map:transformer /map:transformers map:serializers default=xhtml map:serializer logger=sitemap.serializer.xhtml mime-type=text/html name=xhtml pool-grow=2 pool-max=64 pool-min=2 src=org.apache.cocoon.serialization.XMLSerializer doctype-public-//W3C//DTD XHTML 1.0 Transitional//EN/doctype-public doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd/doctype-system encodingiso-8859-1/encoding indent1/indent /map:serializer map:serializer logger=sitemap.serializer.links name=links src=org.apache.cocoon.serialization.LinkSerializer / /map:serializers map:pipelines default=caching map:pipeline name=caching src=org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline / /map:pipelines /map:components map:views map:view from-position=last name=links map:serialize type=links / /map:view /map:views map:pipelines map:pipeline map:generate src=test.html / map:serialize type=xhtml / map:handle-errors map:transform src=error2html.xsl / map:serialize status-code=500 / /map:handle-errors /map:pipeline /map:pipelines /map:sitemap Title: Test - 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]
own generator
Hi All, I'd like to write my own generator. I have written the following generator according to the documents on the Cocoon 2 site, by extending an example. I can start the generator properly, but I can not pass any parameter to it. Somehow I'd like to reach the HTTP request itself (requested URI, headers etc.) within the generator. public class AnyName extends AbstractGenerator { /** * The only implemented method from AbstarctGenerator. * It simply generates SAX events from a string. */ public void generate() throws IOException, SAXException, ProcessingException { //This string will be feeded to the transformer pipeline as sax events String xmlText = doc\nMy first Cocoon 2 generator\n; //This object will read and parse the XML content XMLReader xmlReader = XMLReaderFactory.createXMLReader(); //super.xmlConsumer will receive the SAX events xmlReader.setContentHandler(super.xmlConsumer); String paramNames[] = parameters.getNames(); xmlText += Number of parameters: + paramNames.length + \n; xmlText += Parameter names:\n; for(int i = 0; i paramNames.length; i++) xmlText += paramNames[i] + \n; xmlText += Source: + source + \n; xmlText += /doc; //Create an InputSource from the hardcoded string InputSource src = new InputSource(new StringReader(xmlText)); //Parse the XML input and generate SAX events to the consumer xmlReader.parse(src); } } I use the following pipeline. In the generated XML I could see the parameters, and the source, but it seems that the source is null, and no parameters are passed to the generator. map:pipeline map:match pattern=foo/* map:act type=request map:parameter name=parameters value=true/ map:generate type=ist source={1}/ map:serialize type=xml/ /map:act /map:match map:handle-errors map:transform src=stylesheets/system/error2html.xsl/ map:serialize status-code=500/ /map:handle-errors /map:pipeline How could I get the request data in the generator? Thanks in advance! Br, Istvan - 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: own generator
From: Istvan Beszteri [mailto:[EMAIL PROTECTED]] Hi All, I'd like to write my own generator. I have written the following generator according to the documents on the Cocoon 2 site, by extending an example. I can start the generator properly, but I can not pass any parameter to it. Somehow I'd like to reach the HTTP request itself (requested URI, headers etc.) within the generator. public class AnyName extends AbstractGenerator { ServletGenerator has: protected Request request; ... I use the following pipeline. In the generated XML I could see the parameters, and the source, but it seems that the source is null, and no parameters are passed to the generator. map:pipeline map:match pattern=foo/* map:act type=request map:parameter name=parameters value=true/ map:generate type=ist source={1}/ http://xml.apache.org/cocoon/faq/faq-actions.html#faq-2 See also recent threads. Vadim map:serialize type=xml/ /map:act /map:match map:handle-errors map:transform src=stylesheets/system/error2html.xsl/ map:serialize status-code=500/ /map:handle-errors /map:pipeline How could I get the request data in the generator? Thanks in advance! Br, Istvan - 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]
Accessing SVG's in Cocoon via SVG Serializer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I've a question regarding href's in the image tag of SVG's. Is there a way to access the actual sitemap context from an svg? Example Sitemap: map:pipeline map:match pattern=resources/** map:mount check-reload=yes src=resources/ uri-prefix=resources / /map:match map:match pattern=resize/** map:generate src=dummy.xml / map:transform src=resizer.xsl map:parameter name=uri value={1} / /map:transform map:serialize type=svg2jpeg / /map:match /map:pipeline Example resizer.xsl: xsl:param name=uri select='' / xsl:template match=/ svg viewpoint=0 0 320 240 width=320 height=240 image width=320 height=240 xlink:href=cocoon:{$uri}/ /svg /xsl:template The example above doesn't work. Using file:// is no problem, but I want to use it with dynamically created content, so I can't access the filesystem directly. Thanks in advance Torsten Knodt -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9SDHOvxZktkzSmiwRAsotAKCYbqxxRNPSpECNqPz5cUR2vvE7DwCffYcG rohTz1KgS4ihUGwr513Z0cQ= =80Qr -END PGP SIGNATURE- - 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: own generator
How about this? If I read you right, what you're really going for is not getting the sitemap parameters but the request parameters. There's a difference between doing that from within the sitemap and within java code like this. I'm not positive this will compile, and I'm not 100% positive that this keeps up with any changes in the last few months but I think it's OK on both counts. Of course, one would never want to put all that text formatted data in there - I just wanted to change as little as possible for the sake of comparison. // for the setup() method import org.apache.cocoon.environment.SourceResolver; import java.util.Map; import org.apache.avalon.framework.parameters.Parameters; // used to get and hold the request parameters. import org.apache.cocoon.environment.ObjectModelHelper; import org.apache.cocoon.environment.Request; import java.util.Enumeration; public class NewAnyName extends AbstractGenerator { // will be initialized in the setup() method and used in generate() Request request = null; Enumeration paramNames = null; /** * Implement the generate() method from AbstractGenerator. * It simply generates SAX events using SAX methods. I haven't * tested it, but this has to be faster than parsing them from a string. * I've made comments on many of the original comments (which have been promoted * to really commented out status: ) */ public void generate() throws IOException, SAXException, ProcessingException { // xspAttr will stay empty for this simple implementation // If we had any attributes in our tags, we would add them to this variable // before the call to startElement(), and either create a new AttributesImpl // instance for each element, or reuse one being careful to reset it before // each use. AttributesImpl xspAttr = new AttributesImpl(); // contentHandler is inherited from org.apache.cocoon.xml.AbstractXMLProducer contentHandler.startDocument(); This string will be feeded to the transformer pipeline as sax events // String xmlText = doc\nMy first Cocoon 2 generator\n; // - nope, do this with SAX: contentHandler.startElement(, doc, doc, xspAttr); // NOTE: xml is not the place to worry about line break characters. For the sake of the // simple example, I left many of yours in, but you really would handle the parameter information // using nested tags (which you can do easily by nesting startElement()-endElement() paired calls inside // this element). // By the way, the characters(char[] chars, int start, int end) begs to be overloaded with // a version like characters(String justPutTheWholeThingIn) that handles the conversion // to a character array and assumes you want from beginning to end. I thought some of the cocoon // Generators did this, but I can't find any right now. You'll probably want to set up a convenient // BaseGenerator with helpers like that and extend it for your real Generators. contentHandler.characters(My first Cocoon 2 generator\n.toCharArray(),0,My first Cocoon 2 generator\n.length()); This object will read and parse the XML content // no longer needed since we're using SAX methods //XMLReader xmlReader = XMLReaderFactory.createXMLReader(); super.xmlConsumer will receive the SAX events xmlReader.setContentHandler(super.xmlConsumer); // This is _not_ how you get your request parameters. //String paramNames[] = parameters.getNames(); // text way //xmlText += Number of parameters: + paramNames.length + \n; // SAX way contentHandler.characters((Number of parameters: + paramNames.length + \n).toCharArray(),0,(Number of parameters: + paramNames.length + \n).length()); //same thing: //xmlText += Parameter names:\n; contentHandler.characters((Parameter names: \n).toCharArray(),0,(Parameter names: \n).length()); //for(int i = 0; i paramNames.length; i++) while (paramNames.hasMoreElements()) { //xmlText += paramNames[i] + \n; String param = (String)paramNames.nextElement() + \n; contentHandler.characters(param.toCharArray(),0,param.length()); } //xmlText += Source: + source + \n; contentHandler.characters((Source: + source + \n).toCharArray(),0,(Source: + source + \n).length()); //xmlText += /doc; contentHandler.endElement(,doc, doc); // no longer needed with SAX Create an InputSource from the hardcoded string //InputSource src = new InputSource(new StringReader(xmlText)); // no longer needed with SAX Parse the XML input and generate SAX events to the consumer //xmlReader.parse(src); } public void
object rexx script within xslt
im trying to use the objectrexx script within an xsltransformation my xsl-file has this: lxslt:component prefix=my-ext elements=timelapse functions=calc lxslt:script lang=ObjectRexx ![CDATA[ /* calc rexx - Object Rexx, ---rgf, 2002-07-30, 03:03, wuw */ parse arg mon +3 . day , year /* parse date */ due_date = date(s, space(day mon year), n) /* convert to a sortable date */ due_days = date(b, due_date, s) /* convert to days since 0001-01-01 */ today = date(l) /* get today in a sortable date */ today_days = date(b) /* convert to days since 0001-01-01 */ days=today_days-due_days /* calc difference of days */ due_date = date(L, due_date, s) /* convert to language format */ if days7 then return (Die Differenz beträgt zwischen dem Tag der Abgabe: due_date und heutigem Tage: today days Tage und wird daher noch toleriert.) else if days=7 then return Die Differenz beträgt zwischen dem Tag der Abgabe: due_date und heutigem Tage: today days Tage und wird daher gerade noch toleriert. else /* nur mehr der Fall möglich, dass days7 ist ! */ return (Die Differenz beträgt zwischen dem Tag der Abgabe: due_date und heutigem Tage: today days Tage und wird daher nicht mehr toleriert.) ]] /lxslt:script /lxslt:component xsl:template match=deadline p xsl:value-of select=my-ext:calc(@due_date)/ /p /xsl:template and my xml-file has this: deadline due_date=June 30, 2002/deadline but when i(cocoon) try to transform i get an emty page, it seems that the rexx script did not get the argument from the deadline-node if you would be so kind and have a short look at it thankx gerald - 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: [docs] Installation on resin 2.1.1 (was R: resin 2.1.x problems)
From: Vadim Gritsenko [mailto:[EMAIL PROTECTED]] ... Since it's by far much easier and cleaner than the procedure for previous versions, I suggest it be added to the documentation. How can we achieve this? Please check it out: http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/documentation/xdocs/in stalling/index.xml?rev=1.31content-type=text/vnd.viewcvs-markup Installing on Resin 2.x Hope it helps Vadim L. -Messaggio originale- Da: Robert S. Koberg [mailto:[EMAIL PROTECTED]] Inviato: lunedì 29 luglio 2002 12.12 A: [EMAIL PROTECTED] Oggetto: Re: resin 2.1.x problems Hi, Lorenzo De Sio wrote: I just tried the following procedure (found on this list) to solve my problem w/Resin 2.1.1. It worked. What about adding it to the installation docs? L. Another thing you can do in the RESIN_HOME/conf/resin.conf is: !-- - If true, the classloader order follows the Servlet spec. - If false, the classloader order follows the JDK spec. -- servlet-classloader-hacktrue/servlet-classloader-hack when set to true it goes to your WEB-INF/lib best, -Rob ... - 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]
cocoon 2.0.3 on tomcat 3.2.4
Hello there. I am trying to get cocoon up and running in tomcat 3.2.4. I have done the following: 1. Installed tomcat. 2. Loaded the cocoon.war file into $tomcat_home/webapps. 3. Removed the jaxp.jar file from tomcat/lib. I would remove parser.jar but parser.jar does not exist. 4. Installed xercesImpl-2.0.0.jar, xalan-2.3.1.jar, and xml-apis.jar into tomcat/lib. 5. Installed the same 3 files into Java Home/jre/lib/endorsed/ Every time I try to access the cocoon page: java.lang.NullPointerException at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:999) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:806) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Thread.java:484) Is the output. I have managed to get cocoon 2.0.3 to fire up under tomcat 3.3.1, but I have another webapp that will not run under tomcat 3.3.1. JDK is blackdown 1.3.1 for linux. I have also tried building cocoon from source - same problem. Every time I make a change, I blow away the tomcat/work directory - there's nothing stale there to cause this. I have also tried renaming the xerces jar file to parser.jar to see if that worked. No luck. I can't find anything else in the FAQs to help, nor google groups / google... Help, anyone? Thanks! Crispin -- Those who would improve their argument with volume do nothing but deafen 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]
Forms
Hi Guys, Good Day! On http://xml.apache.org/cocoon/tutorial/tutorial-develop-webapp.html It is written that... The website specification is missing the tags for form building, we will provide an example here: Where can I find the "tags for form building" syntax and description? in the codes... form handler="create-dept.html" p You can create a department by typing in the name and pressing the "submit" button. /p p Name: text name="name" size="30" required="true"/ /p submit name="Create Department"/ note * These fields are required. /note/form How does the handler="create-dept.html" attribute work? The note element is not requiredby the FormValidatorAction right? This element were used onlyby the xsl transformation. Thanks!