tabs in the output
Hi! I don' know if this is OT, beause I cant find the problem! I'm writing a stylesheet that transforms xml int xhtml (Transitional/basic/Mobile Profile). I use Cocoon 2.0.4 as publishing framework. I have a problem with a portion of code generated: The goal is to produce something like this: a href=""Rome/a The xml is like this: city nameRome/name state.../state . /city The stylesheet I wrote is this: xsl:template match="city" . a href=""xsl:value-of select="name"//a . /xsl:template But the result is a href=""Rome/a I think the ":#10;" are tabs, but I really don't know why they are inserted! Of course this causes an error when you follow that link... (not on all browsers... with IE it works correctly, but, for example, with the Nokia Mobile Browser... It doesn't) Is this a encodingproblem?? Or a serialization problem? ( Here I put the serializaer I use... map:serializer logger="sitemap.serializer.xhtml" mime-type="text/html" name="xhtml-Basic" pool-grow="2" pool-max="64" pool-min="2" src="" doctype-public-//W3C//DTD XHTML Basic 1.0//EN/doctype-public doctype-systemhttp://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd/doctype-system /map:serializer ) If yes, How can I solve it?? Any idea is well accepted!! Thank you for all the answers. Best regards, Nesto
Re: tabs in the output
No Lionel, your solution gives me the same result... However thank you for the answer and for the rapidity!!! Nesto - Original Message - From: Lionel Crine [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 20, 2003 4:18 PM Subject: Re: tabs in the output Why don't you try : a xsl:attribute name=hrefresults?city=xsl:value-of select=name//xsl:attribute xsl:value-of select=name/ /a instead of : a href=results?city={name} xsl:value-of select=name/ /a At 16:10 20/03/2003 +0100, you wrote: Hi! I don' know if this is OT, beause I cant find the problem! I'm writing a stylesheet that transforms xml int xhtml (Transitional/basic/Mobile Profile). I use Cocoon 2.0.4 as publishing framework. I have a problem with a portion of code generated: The goal is to produce something like this: a href=results?city=RomeRome/a The xml is like this: city nameRome/name state.../state . /city The stylesheet I wrote is this: xsl:template match=city . a href=results?city={name}xsl:value-of select=name//a . /xsl:template But the result is a href=results?:#10;Rome:#10; Rome/a I think the :#10; are tabs, but I really don't know why they are inserted! Of course this causes an error when you follow that link... (not on all browsers... with IE it works correctly, but, for example, with the Nokia Mobile Browser... It doesn't) Is this a encoding problem?? Or a serialization problem? ( Here I put the serializaer I use... map:serializer logger=sitemap.serializer.xhtml mime-type=text/html name=xhtml-Basic pool-grow=2 pool-max=64 pool-min=2 src=org.apache.cocoon.serialization.XMLSerializer doctype-public-//W3C//DTD XHTML Basic 1.0//EN/doctype-public doctype-systemhttp://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd/doctype -system /map:serializer ) If yes, How can I solve it?? Any idea is well accepted!! Thank you for all the answers. Best regards, Nesto - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tabs in the output
Thank you Robert! Your solution works greatly!!! Thanks to Lionel and Adam too! Bye, Nesto - Original Message - From: Robert Koberg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 20, 2003 4:20 PM Subject: RE: tabs in the output Hi, This will have the same problems and is totally unnecessary. It is much better, IMO, to use attribute value templates '{}' when possible. The problem would be fixed by: a href=results?city={normalize-space(name)} xsl:value-of select=name/ /a best, -Rob -Original Message- Hi! I don' know if this is OT, beause I cant find the problem! I'm writing a stylesheet that transforms xml int xhtml (Transitional/basic/Mobile Profile). I use Cocoon 2.0.4 as publishing framework. I have a problem with a portion of code generated: The goal is to produce something like this: a href=results?city=RomeRome/a The xml is like this: city nameRome/name state.../state . /city The stylesheet I wrote is this: xsl:template match=city . a href=results?city={name}xsl:value-of select=name//a . /xsl:template But the result is a href=results?:#10;Rome:#10; Rome/a I think the :#10; are tabs, but I really don't know why they are inserted! Of course this causes an error when you follow that link... (not on all browsers... with IE it works correctly, but, for example, with the Nokia Mobile Browser... It doesn't) Is this a encoding problem?? Or a serialization problem? ( Here I put the serializaer I use... map:serializer logger=sitemap.serializer.xhtml mime-type=text/html name=xhtml-Basic pool-grow=2 pool-max=64 pool-min=2 src=org.apache.cocoon.serialization.XMLSerializer doctype-public-//W3C//DTD XHTML Basic 1.0//EN/doctype-public doctype-systemhttp://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd/d octype-system /map:serializer ) If yes, How can I solve it?? Any idea is well accepted!! Thank you for all the answers. Best regards, Nesto - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
xml declaration
Hi! I'm trying to serialize my xhtml pages with the xhtml serializer, but I don't want to serialize the xml declaration at the top of the document. This becausewith Pocket Internet Explorer the declaration is visible at the top of the page. I tried this: map:serializer logger="sitemap.serializer.xhtml" mime-type="text/html" name="xhtml-Transitional" pool-grow="2" pool-max="64" pool-min="2" src="" 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 omit-xml-declarationyes/omit-xml-declaration /map:serializer but the page sent still contains the xml declaration. Why?? And how can I solve my problem?? (If I use the html serializer the declaration disappears, but there are problems with the content i want to deliver, so I don't want the html serializer!) Thanks in advance! Nesto
xml header on delivered pages
Hi! I'm designing the interface for mobile devices for a web portal using Cocoon. When I test my pages on a iPaq (with Pocket Internet Explorer) I get the correct page, withouterrors, but with del xml header visualized at the beginning of every page. ?xml version="1.0" encoding="ISO-8859-1"? (and then I get the right content...) Of couse I want to delete it!! Here I write the informations I think are importants for this problem: The XSPsthat are called in a pipeline for a iPaq http request (for example) have at the beginning the xml header (?xml version="1.0" encoding="ISO-8859-1"?), while the xsl doesn't. Then I deliver the markup with this serializer: map:serializer logger="sitemap.serializer.xhtml" mime-type="text/html" name="xhtml-Transitional" pool-grow="2" pool-max="64" pool-min="2" src="" 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 /map:serializer I think the responsible of the writing of the xml header is the serializer, but I have no idea on how solve the problem. Thank you for your help! Nesto
Re: XHTML Mobile profile
Try adding this to your MAIN sitemap.xmap in the serializers section: map:serializer logger="sitemap.serializer.xhtml" mime-type="text/html" name="xhtml-MobileProfile" pool-grow="2" pool-max="64" pool-min="2" src="" doctype-public"-//WAPFORUM//DTD XHTML Mobile 1.0//EN/doctype-public doctype-systemhttp://www.wapforum.org/DTD/xhtml-mobile10.dtd/doctype-system encodingISO-8859-1/encoding /map:serializer You may change the doctype or encoding if you want. And then in your sitemap, you refer to this serializer writing:map:serialize type="xhtml-MobileProfile" / Hope this helps! Nesto - Original Message - From: "zze-MORY Nicolas FTRD/DMI/REN" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 10, 2003 1:16 PM Subject: XHTML Mobile profile does a xHTML Mobile profile SERIALIZER exists for cocoon ? -To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]
xhtml serializers
Hi! How can I define a set of serializers in the sitemap, with which I can deliver xhtml basic or xhtml transitional or xhtml strict? I want to write in my pipelines somthing like this:map:match map:generate.../ map:transform.../ map:serializa type="xhtml-Transitional"/ /map:match I get an error If I write in the MAIN sitemap this 3 serializers: map:serializer logger="sitemap.serializer.xhtml" mime-type="text/html" name="xhtml-Strict" pool-grow="2" pool-max="64" pool-min="2" src="" doctype-public-//W3C//DTD XHTML 1.0 Strict//EN/doctype-public doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd/doctype-system encodingISO-8859-1/encoding /map:serializer map:serializer logger="sitemap.serializer.xhtml" mime-type="text/html" name="xhtml-Transitional" pool-grow="2" pool-max="64" pool-min="2" src="" 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 /map:serializer map:serializer logger="sitemap.serializer.xhtml" mime-type="text/html" name="xhtml-Basic" pool-grow="2" pool-max="64" pool-min="2" src="" doctype-public"-//W3C//DTD XHTML Basic 1.0//EN/doctype-public doctype-systemhttp://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd/doctype-system encodingISO-8859-1/encoding /map:serializer I changed only the name of the serializer and the value of the parameters (DTD..). Do I have to change something else? Please, tell me if this is correct.. maybe the problem is not here! Thank you!!! Nesto
XSP question
Hi! Sorry if I repost a question, but I need help! I want to convert my JSP in XSP, and I have to reuse complex Javabeans. I read in the Logicsheet documentatin that there is a xbean library that provides functionallity similar to the jsp:useBean directives. But I didn't found much more documentation, and I don't know how to use it! Where I can read more? Please give me some hint on how"translate" my jsp:useBean id="xxx" scope="session" class="yyy.zzz" / of my old JSP, in code for my new XSP Regards, Nesto
Re: failure in request parameters
Hi Eduardo! I have the same problem with a jsp. HereI forward you the (only) answer I received from the cocoon developers mailing list, with my original message. Maybe it can help you. Now I'm thinking in translate myJSPs in XSPs as you can read on my posts (but I haven't received any answer yet), but I we can solve this problem it would be better! If you have some solution please, tell me! Regards, Nesto - Original Message - From: "Konstantin Piroumian" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 18, 2003 10:43 AM Subject: Re: Is this a bug? Check if the JSP samples work. If yes, then probably there's an error somewhere in your code that causes an exception which is handled incorrectly in the recent Cocoon (according to rumors in users list). Also, you can use the JSPReader to get the pure output of your JSP and then check Cocoon logs to see if there are any exceptions (except the Illegal state one). Konstantin - Original Message - From: Nesto To: [EMAIL PROTECTED] Sent: Tuesday, February 18, 2003 10:29 AM Subject: Is this a bug? Hello! I have a problem with a JSP generator, and after manyattempts,now I think that there could be a bug. So I need your help! I use Cocoon 2.0.4 with Tomcat 4.1.18, on a server that runs Linux RedHat 8. Here I write my simple test code: The jsp (named prova.jsp)generates a small xml data, and reads a request parameter from the http request. %@ page contentType="text/xml"%?xml version="1.0"?document parametro%=request.getParameter("name")%/parametro/document This simple jsp was included as generator in my sitemap: ?xml version="1.0"? map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0" map:components map:generators default="file"/ map:transformers default="xslt"/ map:readers default="resource"/ map:serializers default="html"/ map:selectors default="browser"/ map:matchers default="wildcard"/ /map:components map:pipelines map:pipeline map:match pattern="prova.jsp" map:act type="request" map:parameter name="parameters" value="true"/ map:generate type="jsp" src="" mime-type="text/xml"/ map:serialize type="xml"/ /map:act /map:match /map:pipeline /map:pipelines /map:sitemap !-- end of file -- I think there is nothing wrong in this sitemap! But when I request http://myHost:8080/cocoon/myApp/prova.jsp?name=xyz I get the exception: HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception java.lang.IllegalStateException at org.apache.coyote.tomcat4.CoyoteResponseFacade.reset(CoyoteResponseFacade.java:251) at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1115) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.in
XSP and JavaBeans
Hi, I want toconvert my JSP (that actually generates my xml data)in XSP foruse them with Cocoon. My JSP are based on JavaBeans and import some custom classes. Is there a way to reuse this components? My classes can be imported with the element xsp:include, but howcan I include my Beans in a way similar to the jsp:useBean... directive? Thank you! Nesto
Newbie: where is the error?
Hi! I use someJSP for the xml-data generation. These JSPs import some java classes for query a database, and so on... These classes are used ONLY in the JSPs. Where I have to put these java classes on the cocoon context?? In the folder cocoon/WEB-INF? Or somewhere inside the cocoon/myApp folder?? Do I have to configure the file cocoon.xconf for using of my customclasses? Sorryfor my newbiequestion, butI can't find where the error is! In thesub-sitemap I wrote: map:match pattern="userdata.jsp" map:act type="request" map:parameter name="parameters" value="true"/ map:generate type="jsp" src="" mime-type="text/xml"/ map:transform src=""/ -- map:serialize type="xhtml"/ /map:act /map:match But, when I request http://myHost:8080/cocoon/myApp/userdata.jsp (of course with the parameters passed through an xhtml form) I can only obtain this: HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception java.lang.IllegalStateException at org.apache.coyote.tomcat4.CoyoteResponseFacade.reset(CoyoteResponseFacade.java:251) at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1115) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)...Thank you for the help!Nesto
Re: Passing parameters
Hi Eduardo! Your question is general, I don' know if I understand it well. However, in the past weeks I had the same problem. Here I post you the solution I found, with the great help of this community. Hope this help for your problem to. I wanted to write a matcher for an URI of this type: http://myhost.com:8080/cocoon/myApp/list.jsp?param=value The matcher is: map:match pattern=*.jsp map:act type=request map:parameter name=parameters value=true / map:generate type=file src=http://anotherhost:8080/anotherApp{../1}.jsp?param={param}; mime-type=text/xml/ map:transform src=stylesheets/{../1}.xsl/ map:serialize type=xhtml/ /map:act /map:match Note: the jsp that generates xml data is included with type=file and not as type=jsp Nesto - Original Message - From: Eduardo Zurita [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 11, 2003 2:16 PM Subject: Re: Passing parameters OK. is there a way to pass a parameter from the user querystring to a JSP generator? Thanks in advance Eduardo. - 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]
Session managing problem
Hi! I have a problem with the session managing. I'm trying towrite a user interface of an existing system using cocoon as publishing framework. The system is composed of a set of JSPs that generates xml data from a database. So the pipelines inthe sitemap I wrote are all of this type: map:match pattern="*.jsp" map:act type="request" map:parameter name="parameters" value="true"/ map:generate type="file" src="" mime-type="text/xml"/ map:transform src=""/ map:serialize type="xhtml"/ /map:act /map:match The REMOTE application manage itselfthe usersessions, but i don't how i have to modify my sitemap in order to let client and the remote application exchange session informations. In this moment the presence of Cocoon between client and Remote App causes the loss of session information (accessing through IE directly, I can see the correct xml data) I read the documentation on Cocoon site, and on Wiki, and I found something that looks interesting: the matchers of type cookie and sessionstate. But the problem is that I really haven't understand how I can use them. Thanks foryour answers! Nesto
Re: matcher of a request
Dear Hussayn, sorry, but this more generic matcher doesn't works! The same matcher with the parameters explicitly written works! I don't know why. Your solution is better and the sitemap would be shorter... If you can tell me if there is a difference... thank you! Nesto - Original Message - From: SAXESS - Hussayn Dabbous [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 06, 2003 12:36 PM Subject: Re: matcher of a request You can make this even more generic: map:match pattern=*.jsp map:act type=request map:generate type=file src=http://anotherhost:8080/anotherApp{../1}.jsp{requestQuery}; mime-type=text/xml/ map:transform src=stylesheets/{../1}.xsl/ map:serialize type=xhtml/ /map:act /map:match This will simply copy the GET-parameters from your original request ;-) and i think it's slightly more performant ... regards, Hussayn Nesto wrote: Thank you Jan for your help!! Finally I wrote a matcher that works fine! I post it to the group because it could be interesting. I wanted to write a matcher for an URI of this type: http://myhost.com:8080/cocoon/myApp/list.jsp?user=tompassword=tom The matcher is: map:match pattern=*.jsp map:act type=request map:parameter name=parameters value=true / map:generate type=file src=http://anotherhost:8080/anotherApp{../1}.jsp?username={username}amp;pa ssword={password} mime-type=text/xml/ map:transform src=stylesheets/{../1}.xsl/ map:serialize type=xhtml/ /map:act /map:match Hope this helps someone else! Nesto! - 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: matcher of a request
Thank you Jan for your help!! Finally I wrote a matcher that works fine! Ipost it to the group because it could be interesting. I wanted to write a matcher for anURI of this type: http://myhost.com:8080/cocoon/myApp/list.jsp?user=tompassword=tom The matcher is: map:match pattern="*.jsp" map:act type="request" map:parameter name="parameters" value="true" /map:generate type="file" src="" mime-type="text/xml"/ map:transform src=""/ map:serialize type="xhtml"/ /map:act/map:match Hope this helps someone else! Nesto! - Original Message - From: Jan Harms To: [EMAIL PROTECTED] Sent: Wednesday, February 05, 2003 3:29 PM Subject: AW: matcher of a request Nesto, I´m not sure if this works, but try /map:match map:match pattern="*.jsp" map:generate type="file" src=""http://anotherHost:8080/theApp/{1}.jsp?user={request:user}password={request:password}">http://anotherHost:8080/theApp/{1}.jsp?user={request:user}password={request:password}" / map:transform src=""/ map:serialize type="xhtml"//map:match The {request:yourparam} parts are so called input-modules. See: http://xml.apache.org/cocoon/userdocs/concepts/modules.html Be careful with the generator type you choose. The JSP generator expects the location of a JSP-File. You are calling a jsp from another server, that means you have to use a generator that matches the *output* of this jsp. I.e if the jsp producesHTML you need the HTML-generator. In your case you need the file-generator since the jsp produces XML. Hope this helps, -Jan Harms
matcher of a request
How can I write a matcher for this type of request: http://myhost.com:8080/cocoon/myApp/list.jsp?user=tompassword=tom I can't write a matcher that runs fine! I don't know how the parameters can be passed. The jsp runs on another server and generates a xml document. /map:match map:match pattern="*.jsp" map:generate type="jsp" src="" / map:transform src=""/ map:serialize type="xhtml"//map:match How I have to modify the matcher?? Thanks in advance! Nesto
Parameters to a JSP page
Hi to everyone!I'm a newbie of Cocoon and I have a problem with parameters of a Jsp.I don't know how I can pass a set of parameters to a jsp from a html-form.I'll explain my problem better:I have a form in a html page generated through Cocoon (xml-xsl-html). This is a login page, and there are two parameters: username and password.I have to pass them to a jsp page that queries a database and generate dynamic data for the specific user. I read the documentation, and I think I have to use actions, but my attemps of doing it failed. Does someone can explain me how I can do it? If you know how do it, please, give me some hints, or pieces of sitemap that helps me to resolve my problem. I use Cocoon 2.0.4 on Tomcat 4.1.18.I have to use the JSPs because is a part of an existing system. Thanks to everyone and sorry for my english!Regards, Nesto