Re: xsp question
I use Netbeans to check the xml. It can also be used for performing xslt per file rather than building the cocoon war and redeploying it on tomcat. For some xml I've also got it to validate the xml to the dtd and xsd's. For xsp I've only verified checking it for wellformness. I also recommend that you reorganise your project so that it isn't sub to the Cocoon examples; just use what is needed, the cocoon-*.jar's and lib dependencies for starters. It is also possible to work on your webapp in it's deployed directories and then eventually bring it back to a project directory and develop a build.xml for ant at that point. When working in it's deployed state, out of nervousness I make sure there is no associated war file in tomcat/webapps and constantly delete the associated tomcat work files in the tomcat/work/Catalina/localhost/mywebapp. When testing xsp's I leave the work files and put a mount in Netbeans at the package root of the generated *_xsp.java files. A code writing cycle which includes Cocoon build and deployment can be debilitating to say the least. Can be a real stumbling block for developers working with Cocoon for the first time. It is completely unnecessary but it is the way the all-to-familiar Cocoon developer's have structured their project. Otherwise Cocoon is a powerful servlet. -Roger - Original Message - From: Tim Bachta [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 6:11 PM Subject: RE: xsp question I tried using more tags like you suggested and I get an error: The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. End tag 'content' does not match the start tag 'tasks'. Error processing resource 'http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1'. Line 167, Position 3 /content --^ Thanks Tim Bachta -Original Message- From: Roger I Martin PhD [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 4:51 PM To: [EMAIL PROTECTED] Subject: Re: xsp question You need to put more starts and stops(only where your doing Java) to the xsp:logic...see below. at the bottom I pasted some xsp with logic that I know is working. - Original Message - From: Tim Bachta [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 4:33 PM Subject: xsp question I am trying to use logic in an xsp page to get the output formatted correctly, here is what I want the output to look like taskanddate date2003-05-20/date tasks deviation0/deviation completed-bySomebodys, Name/completed-by deviation0/deviation completed-bySomebodys, Name2/completed-by deviation0/deviation completed-bySomebodys, Name3/completed-by /tasks /taskanddate here is the code that I am using xsp:logic String date = esql:get-string column=3/; if(!date.equalsIgnoreCase(oldDate)) { oldDate = date; /xsp:logic taskanddate date esql:get-string column=3/ /date tasks xsp:logic } /xsp:logic compleated-by esql:get-string column=4/ /compleated-by xsp:logic if(!date.equalsIgnoreCase(oldDate)) { /xsp:logic /tasks /taskanddate xsp:logic } /xsp:logic and here is the result that I am getting: http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - taskanddate date2003-05-22 00:00:00.0/date http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - tasks } compleated-by / if(!date.equalsIgnoreCase(oldDate)) { /tasks /taskanddate http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - taskanddate date2003-05-23 00:00:00.0/date http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - tasks } compleated-by / if(!date.equalsIgnoreCase(oldDate)) { /tasks /taskanddate http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - taskanddate date2003-05-24 00:00:00.0/date http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - tasks } compleated-by / if(!date.equalsIgnoreCase(oldDate)) { /tasks /taskanddate If anyone knows of a way to do this correctly I would greatly appreciate the help. Thank you Tim Bachta xsp:logic if(!selectMap amp;amp; parameterNames!=null amp;amp; parameterNames.lengthgt;0) { //System.out.println(here); str=mapIDValues[0]; boolean check=false; int index=str.length()-1; while(!check amp;amp; indexgt;=0) { if(!Character.isDigit(str.charAt(index
xsp question
I am trying to use logic in an xsp page to get the output formatted correctly, here is what I want the output to look like taskanddate date2003-05-20/date tasks deviation0/deviation completed-bySomebodys, Name/completed-by deviation0/deviation completed-bySomebodys, Name2/completed-by deviation0/deviation completed-bySomebodys, Name3/completed-by /tasks /taskanddate here is the code that I am using xsp:logic String date = esql:get-string column=3/; if(!date.equalsIgnoreCase(oldDate)) { oldDate = date; taskanddate date esql:get-string column=3/ /date tasks } compleated-by esql:get-string column=4/ /compleated-by if(!date.equalsIgnoreCase(oldDate)) { /tasks /taskanddate } /xsp:logic and here is the result that I am getting: http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - taskanddate date2003-05-22 00:00:00.0/date http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - tasks } compleated-by / if(!date.equalsIgnoreCase(oldDate)) { /tasks /taskanddate http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - taskanddate date2003-05-23 00:00:00.0/date http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - tasks } compleated-by / if(!date.equalsIgnoreCase(oldDate)) { /tasks /taskanddate http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - taskanddate date2003-05-24 00:00:00.0/date http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - tasks } compleated-by / if(!date.equalsIgnoreCase(oldDate)) { /tasks /taskanddate If anyone knows of a way to do this correctly I would greatly appreciate the help. Thank you Tim Bachta - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: xsp question
I tried using more tags like you suggested and I get an error: The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. End tag 'content' does not match the start tag 'tasks'. Error processing resource 'http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1'. Line 167, Position 3 /content --^ Thanks Tim Bachta -Original Message- From: Roger I Martin PhD [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 4:51 PM To: [EMAIL PROTECTED] Subject: Re: xsp question You need to put more starts and stops(only where your doing Java) to the xsp:logic...see below. at the bottom I pasted some xsp with logic that I know is working. - Original Message - From: Tim Bachta [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 4:33 PM Subject: xsp question I am trying to use logic in an xsp page to get the output formatted correctly, here is what I want the output to look like taskanddate date2003-05-20/date tasks deviation0/deviation completed-bySomebodys, Name/completed-by deviation0/deviation completed-bySomebodys, Name2/completed-by deviation0/deviation completed-bySomebodys, Name3/completed-by /tasks /taskanddate here is the code that I am using xsp:logic String date = esql:get-string column=3/; if(!date.equalsIgnoreCase(oldDate)) { oldDate = date; /xsp:logic taskanddate date esql:get-string column=3/ /date tasks xsp:logic } /xsp:logic compleated-by esql:get-string column=4/ /compleated-by xsp:logic if(!date.equalsIgnoreCase(oldDate)) { /xsp:logic /tasks /taskanddate xsp:logic } /xsp:logic and here is the result that I am getting: http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - taskanddate date2003-05-22 00:00:00.0/date http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - tasks } compleated-by / if(!date.equalsIgnoreCase(oldDate)) { /tasks /taskanddate http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - taskanddate date2003-05-23 00:00:00.0/date http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - tasks } compleated-by / if(!date.equalsIgnoreCase(oldDate)) { /tasks /taskanddate http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - taskanddate date2003-05-24 00:00:00.0/date http://localhost:8080/cocoon/vyzo/Room_Report_pdf?cocoon-view=debug1## - tasks } compleated-by / if(!date.equalsIgnoreCase(oldDate)) { /tasks /taskanddate If anyone knows of a way to do this correctly I would greatly appreciate the help. Thank you Tim Bachta xsp:logic if(!selectMap amp;amp; parameterNames!=null amp;amp; parameterNames.lengthgt;0) { //System.out.println(here); str=mapIDValues[0]; boolean check=false; int index=str.length()-1; while(!check amp;amp; indexgt;=0) { if(!Character.isDigit(str.charAt(index))) { check=true; index++; } else if(index==0) { check=true; } else { index--; } } if(check) { mapIDPrefix=str.substring(0,index); mapIDIndex=Integer.parseInt(str.substring(index,str.length())); } /xsp:logic table border=1 CAPTIONMap Locations/CAPTION trthLocation #/ththX/ththY/ththMAP_ID/th/tr xsp:logic int count=1; for(index=0;indexlt;xValues.length;index++) { if(removeRowSet.elementAt(index)==null) { str=xValues[index]; /xsp:logic trtdxsp:exprcount/xsp:expr/td tdinput type=text xsp:attribute name=nameX/xsp:attribute xsp:attribute name=valuexsp:exprstr/xsp:expr/xsp:attribute /input/td xsp:logic str=yValues[index]; /xsp:logic tdinput type=text xsp:attribute name=nameY/xsp:attribute xsp:attribute name=valuexsp:exprstr/xsp:expr/xsp:attribute /input/td xsp:logic str=mapIDPrefix+mapIDIndex; /xsp:logic tdinput type=text xsp:attribute name=nameMAP_ID/xsp:attribute xsp:attribute name=valuexsp:exprstr/xsp:expr
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
AW: XSP question
hi nesto, I don't know the xbean logicsheet at all (doesn't seem to be in cocoon = 2.0.4), but anyway; in the simplest case, the jsp:useBean boils down to a variable declaration (scope = page): jsp:useBean id=myBean scope=page class=mypackage.MyClass/ would have an equivalent of something like this: xsp:logic mypackage.MyClass myBean = new mypackage.MyClass (); /xsp:logic for the other scopes you have to store/load those variables in/from the respective contexts: for session scope it's the session, for application scope it's the ServletContext. both have getAttribute()/setAttribute() which you can utilize. hope this helps, in case that xbean logicsheet is not available. you eventually might want to take a lookt at the JSP spec. -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag von Nesto Gesendet: Mittwoch, 19. Februar 2003 15:11 An: [EMAIL PROTECTED] Betreff: 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 - 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: AW: XSP question
no xbean logicsheet exists in 2.x. I have seen a start of such from 1.x but it would be non-functional now. The advice below should be what you need, with the obvious understanding that autopopulating fields as you get with useBean does not exist. Geoff Howard At 02:46 PM 2/19/2003, you wrote: hi nesto, I don't know the xbean logicsheet at all (doesn't seem to be in cocoon = 2.0.4), but anyway; in the simplest case, the jsp:useBean boils down to a variable declaration (scope = page): jsp:useBean id=myBean scope=page class=mypackage.MyClass/ would have an equivalent of something like this: xsp:logic mypackage.MyClass myBean = new mypackage.MyClass (); /xsp:logic for the other scopes you have to store/load those variables in/from the respective contexts: for session scope it's the session, for application scope it's the ServletContext. both have getAttribute()/setAttribute() which you can utilize. hope this helps, in case that xbean logicsheet is not available. you eventually might want to take a lookt at the JSP spec. -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag von Nesto Gesendet: Mittwoch, 19. Februar 2003 15:11 An: [EMAIL PROTECTED] Betreff: 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 - 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: AW: XSP question
I use helpbean logicsheet http://www.oio.de/m/taglib/beanhelp.zip xsp:page xmlns:xsp=http://apache.org/xsp; xmlns:help=http://www.oio.de/help; page help:useBean id=vm scope=page class=Common/ help:setProperty name=vm property=path param=path/ someTaghelp:getProperty name=vm property=someProperty//someTag /page /xsp:page Mark -Original Message- From: Geoff Howard [mailto:[EMAIL PROTECTED]] Sent: 19 February 2003 08:45PM To: [EMAIL PROTECTED] Subject: Re: AW: XSP question no xbean logicsheet exists in 2.x. I have seen a start of such from 1.x but it would be non-functional now. The advice below should be what you need, with the obvious understanding that autopopulating fields as you get with useBean does not exist. Geoff Howard At 02:46 PM 2/19/2003, you wrote: hi nesto, I don't know the xbean logicsheet at all (doesn't seem to be in cocoon = 2.0.4), but anyway; in the simplest case, the jsp:useBean boils down to a variable declaration (scope = page): jsp:useBean id=myBean scope=page class=mypackage.MyClass/ would have an equivalent of something like this: xsp:logic mypackage.MyClass myBean = new mypackage.MyClass (); /xsp:logic for the other scopes you have to store/load those variables in/from the respective contexts: for session scope it's the session, for application scope it's the ServletContext. both have getAttribute()/setAttribute() which you can utilize. hope this helps, in case that xbean logicsheet is not available. you eventually might want to take a lookt at the JSP spec. -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag von Nesto Gesendet: Mittwoch, 19. Februar 2003 15:11 An: [EMAIL PROTECTED] Betreff: 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 - 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: newbie xsp question
I don't know why the simple.xsp was done the way it was but I believe you should also be able to write it this way: xsp:logic for (int i=0; i lt; 3; i++) { liItem xsp:expri/xsp:expr/li } /xsp:logic I think wrapping it in CDATA sections is just to make it possible to use the in the for statement I-Lin Kuo wrote: In the sample xsp provided with cocoon, on the page docs/samples/xsp/simple.xsp There's a section of code that looks like this: xsp:logic ![CDATA[ for (int i=0; i3; i++) {]]![CDATA[ ]] li Item xsp:expri/xsp:expr /li ![CDATA[ } ]]![CDATA[ ]] /xsp:logic I understand that the CDATA sections are needed to escape the in the for loop declaration, but it seems to me that only one such is needed. To test this, I made up another page with the following: ul xsp:logic ![CDATA[ for (int j=0;j3;j++) ]]{ liItem xsp:exprj/xsp:expr/li } /xsp:logic /ul This worked, and confirmed my suspicions. So my question is, why were there so many CDATA sections in the original, and when am I supposed to use them? Also, I'd appreciate it if someone could explain what xsp:content is supposed to do, or refer me to some place in the documentation where all the tags are listed (I couldn't find any). _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - 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]
newbie xsp question
In the sample xsp provided with cocoon, on the page docs/samples/xsp/simple.xsp There's a section of code that looks like this: xsp:logic ![CDATA[ for (int i=0; i3; i++) {]]![CDATA[ ]] li Item xsp:expri/xsp:expr /li ![CDATA[ } ]]![CDATA[ ]] /xsp:logic I understand that the CDATA sections are needed to escape the in the for loop declaration, but it seems to me that only one such is needed. To test this, I made up another page with the following: ul xsp:logic ![CDATA[ for (int j=0;j3;j++) ]]{ liItem xsp:exprj/xsp:expr/li } /xsp:logic /ul This worked, and confirmed my suspicions. So my question is, why were there so many CDATA sections in the original, and when am I supposed to use them? Also, I'd appreciate it if someone could explain what xsp:content is supposed to do, or refer me to some place in the documentation where all the tags are listed (I couldn't find any). _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - 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 Question
Title: XSP Question Hello all, I gather address information for different companies and allow for them to then later update the existing address information. I am using cinclude address.xsp to my page.xsp. I need my address.xsp to perform the following, but I am not sure how to create this as an xsp. I need to be able to reuse the name, address, etc pieces in multiple places. The concept is like calling a name function in Java. I don't want to create an xsp for each name, address, etc. Has anyone done anything like this, or know how it can be accomplished? if Adding { name address city state zip } if Editing { address city state zip } name { additional stuff for name } address { additional stuff for address } etc.
RE: cocoon class(es) at SD West 2002; XSP question
thanks for your prompt reply, Vadim. i apologize for my poor choice of words (and i call myself a WRITER! sheesh!). by incoming i meant sauntering gaily down the pipeline. for example, i want to take kazoo.xml, a static file lurking on my disk, slurp it with a FileGenerator, and then mess it about with some Java logic -- but (so far) i haven't found a way to do that. OTOH, you've shown me a useful technique for other applications, so merci encore. rw On Mon, 2002-04-29 at 13:44, Vadim Gritsenko wrote: Define incoming XML here. Is it XML posted as http request's body? Or request parameter containing XML? I will assume latter. You could (skipping all preparations): Node node = XPathAPI.selectNode(parser.parse(request.getParameter(xmlparam), kazoo); signature.asc Description: This is a digitally signed message part
RE: cocoon class(es) at SD West 2002; XSP question
From: Rick [mailto:[EMAIL PROTECTED]] thanks for your prompt reply, Vadim. i apologize for my poor choice of words (and i call myself a WRITER! sheesh!). :) by incoming i meant sauntering gaily down the pipeline. for example, i want to take kazoo.xml, a static file lurking on my disk, slurp it with a FileGenerator, Ok, here we have got a problem. IIRC, we were talking about XSP generator here. XSP generator is *generator*, which basically means that it *generates* XML, in SAX world it means that it is XMLProducer. By definition, generator can not *consume* XML coming from any other source (in SAX world - it can not be XMLConsumer). and then mess it about with some Java logic -- but You could write transformer for this. I even thought one time about transformers in XSP, based on something like STX, but found that I do not have enough time to implement this. (so far) i haven't found a way to do that. And this is good, otherwise I will be surprised ;) Vadim OTOH, you've shown me a useful technique for other applications, so merci encore. rw On Mon, 2002-04-29 at 13:44, Vadim Gritsenko wrote: Define incoming XML here. Is it XML posted as http request's body? Or request parameter containing XML? I will assume latter. You could (skipping all preparations): Node node = XPathAPI.selectNode(parser.parse(request.getParameter(xmlparam), kazoo); - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cocoon class(es) at SD West 2002; XSP question
it was touch-and-go for awhile there -- i'd managed to munch all copies of the presentation on my hard disk using Windows' hibernate feature -- but my cocoon class at the software dev west conference wound up coming off OK. there were about 20 people in the audience, so i'm hoping i sold a few (i know at least a couple of the people who were there will be seeing this, so i won't brag too shamelessly. otherwise they'll sic the Snoozing Alien on me). i've already asked the show if they'll let me do it again for SD East in november. question for then: i said in the class, and still believe, that java code in XSP can't access incoming XML. picture if you will a toy XML document: page kazooI make rude noises/kazoo /page then an XSP.xsl that processes it (i'm leaving off all the namespace and other gradu): xsp:logic // Here we extract the content of the kazoo element into // a Vector of words Vector kazooWords = new Vector(??) /xsp:logic am i off base here? to my knowledge, there is no way for that Java code to spelunk into the SAX events (C2) or DOM tree (C1) and get at element contents or attributes. i feel a little silly asking such a basic question after teaching a class, but i make no claim to omniscience! thanks for your help, rw signature.asc Description: This is a digitally signed message part
RE: cocoon class(es) at SD West 2002; XSP question
From: Rick [mailto:[EMAIL PROTECTED]] it was touch-and-go for awhile there -- i'd managed to munch all copies of the presentation on my hard disk using Windows' hibernate feature -- but my cocoon class at the software dev west conference wound up coming off OK. there were about 20 people in the audience, so i'm hoping i sold a few (i know at least a couple of the people who were there will be seeing this, so i won't brag too shamelessly. otherwise they'll sic the Snoozing Alien on me). i've already asked the show if they'll let me do it again for SD East in november. question for then: i said in the class, and still believe, that java code in XSP can't access incoming XML. Define incoming XML here. Is it XML posted as http request's body? Or request parameter containing XML? I will assume latter. picture if you will a toy XML document: page kazooI make rude noises/kazoo /page then an XSP.xsl that processes it (i'm leaving off all the namespace and other gradu): xsp:logic // Here we extract the content of the kazoo element into // a Vector of words Vector kazooWords = new Vector(??) You could (skipping all preparations): Node node = XPathAPI.selectNode(parser.parse(request.getParameter(xmlparam), kazoo); Vadim /xsp:logic am i off base here? to my knowledge, there is no way for that Java code to spelunk into the SAX events (C2) or DOM tree (C1) and get at element contents or attributes. i feel a little silly asking such a basic question after teaching a class, but i make no claim to omniscience! thanks for your help, rw - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
XSP question: How to set tag attributes dynamically?
Dear colleagues, does anybody know how I can set a tag attribute within xsp, for example ... String theLanguage = en; hello language=en/hello ... How can I fill the en into the language attribute from the JAVA variable? The same problem is to set dynamic tags: xsp:element name=???.../xsp:element How can I fill the ??? from JAVA? Thank you, best regards - Volker - - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XSP question: How to set tag attributes dynamically?
Hello, String yourString = blah; ... xsp:element xsp:param name=namexsp:expryouString/xsp:expr/xsp:param xsp:attribute name=whatever xsp:exrpyourString/xsp:expr /xsp:attribute /xsp:element will create: blah whatever=blah /blah I hope ;) For more info look in: cocoon-2.0.2/src/java/org/apache/cocoon/components/language/xsp/java xsp.xsl - for all xsp tags others.xsl - for how they can be used. Artur... -Original Message- From: Volker Schneider [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 9:57 AM To: [EMAIL PROTECTED] Subject: XSP question: How to set tag attributes dynamically? Dear colleagues, does anybody know how I can set a tag attribute within xsp, for example ... String theLanguage = en; hello language=en/hello ... How can I fill the en into the language attribute from the JAVA variable? The same problem is to set dynamic tags: xsp:element name=???.../xsp:element How can I fill the ??? from JAVA? Thank you, best regards - Volker - - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.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/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XSP question: How to set tag attributes dynamically?
Hi Artur, thank you very much, that works fine. Best regards, Volker -Original Message- From: Artur Bialecki [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 25. April 2002 16:27 To: [EMAIL PROTECTED] Subject: RE: XSP question: How to set tag attributes dynamically? Hello, String yourString = blah; ... xsp:element xsp:param name=namexsp:expryouString/xsp:expr/xsp:param xsp:attribute name=whatever xsp:exrpyourString/xsp:expr /xsp:attribute /xsp:element will create: blah whatever=blah /blah I hope ;) For more info look in: cocoon-2.0.2/src/java/org/apache/cocoon/components/language/xsp/java xsp.xsl - for all xsp tags others.xsl - for how they can be used. Artur... -Original Message- From: Volker Schneider [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 9:57 AM To: [EMAIL PROTECTED] Subject: XSP question: How to set tag attributes dynamically? Dear colleagues, does anybody know how I can set a tag attribute within xsp, for example ... String theLanguage = en; hello language=en/hello ... How can I fill the en into the language attribute from the JAVA variable? The same problem is to set dynamic tags: xsp:element name=???.../xsp:element How can I fill the ??? from JAVA? Thank you, best regards - Volker - - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.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/faqs.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/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XSP Question
-Original Message- From: Joseph Rajkumar [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 19, 2002 12:37 AM To: cocoon-users Subject: XSP Question Hi Folks I have taken Konstantin Piroumian's sample logic sheet ie db.xsp and I am trying to modify it so that I could select from a certain range of date ie I want to use the LIMIT # # command to select and I am using the following syntax !-- This portion does not work -- xsp:element name=db:employees xsp:attribute name=start xsp:content xsp:expr xsp-request:get-parameter name=start default=0/ /xsp:expr /xsp:content /xsp:attribute xsp:attribute name=count xsp:content xsp:expr xsp-request:get-parameter name=count default=7/ /xsp:expr /xsp:content /xsp:attribute /xsp:element Range attributes are not supported by db logicsheet, it's just a sample. To add some new features you should add them to the logicsheet (see db.xsl). -- Konstantin Piroumian [EMAIL PROTECTED] !-- This works but gets all the employees -- db:employees /db:employees Any help will be greatly appreciated. Joseph Rajkumar email: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.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/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSP Question
Hi I understand that db.xsl has to be modified, but my problem is that I am not able to set any attribute values for the db:employees tag. In this case I am trying to set the attribute start to some value or default of 0 and count to some value or a default of 7, but when I try to print the value of @start or @count in the db.xsl, it does not contain any values at all. Regards Joseph Rajkumar == !-- This portion does not work -- xsp:element name=db:employees xsp:attribute name=start xsp:content xsp:expr xsp-request:get-parameter name=start default=0/ /xsp:expr /xsp:content /xsp:attribute xsp:attribute name=count xsp:content xsp:expr xsp-request:get-parameter name=count default=7/ /xsp:expr /xsp:content /xsp:attribute /xsp:element Range attributes are not supported by db logicsheet, it's just a sample. To add some new features you should add them to the logicsheet (see db.xsl). - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XSP Question
From: Joseph Rajkumar [mailto:[EMAIL PROTECTED]] Hi I understand that db.xsl has to be modified, but my problem is that I am not able to set any attribute values for the db:employees tag. In this case I am trying to set the attribute start to some value or default of 0 and count to some value or a default of 7, but when I try to print the value of @start or @count in the db.xsl, it does not contain any values at all. So, maybe the problem is not in db.xsl? Are you sure that you get request params as expected? Look at the generated XSP java class to see where the problem can be. -- Konstantin Piroumian [EMAIL PROTECTED] Regards Joseph Rajkumar == !-- This portion does not work -- xsp:element name=db:employees xsp:attribute name=start xsp:content xsp:expr xsp-request:get-parameter name=start default=0/ /xsp:expr /xsp:content /xsp:attribute xsp:attribute name=count xsp:content xsp:expr xsp-request:get-parameter name=count default=7/ /xsp:expr /xsp:content /xsp:attribute /xsp:element Range attributes are not supported by db logicsheet, it's just a sample. To add some new features you should add them to the logicsheet (see db.xsl). - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.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/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
XSP Question
Hi Folks I have taken Konstantin Piroumian's sample logic sheet ie db.xsp and I am trying to modify it so that I could select from a certain range of date ie I want to use the LIMIT # # command to select and I am using the following syntax !-- This portion does not work -- xsp:element name=db:employees xsp:attribute name=start xsp:content xsp:expr xsp-request:get-parameter name=start default=0/ /xsp:expr /xsp:content /xsp:attribute xsp:attribute name=count xsp:content xsp:expr xsp-request:get-parameter name=count default=7/ /xsp:expr /xsp:content /xsp:attribute /xsp:element !-- This works but gets all the employees -- db:employees /db:employees Any help will be greatly appreciated. Joseph Rajkumar email: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: Re: Newbie XSP question - why dosn't this work?
Please let me know if some more info can help you guys help me, and I will include it ASAP. I really need some help here you see :) I... What... But... Ok tjeck this one out (this will probably not make any sence to people new to this thread): I have my old Java object that returns XML to my logicsheet. This object can return a lot of different XML, depending on what parameters it get (my super duper framework - joke). Now I have two different XML outputs on two different URL's. Each work just fine, C2 processes my XML just fine. But if I hit XML1-URL C2 processes the XML, and if I then hit XML2-URL reight thereafter it prints out the XML (my old problem returns), and I have to restart C2 to get XML2-URL to work correctly. And vise versa if I start by hitting XML2-URL (after a restart) it works but then XML1-URL fails (yes the old XML-printout problem again again). Are you confused, I know I am. I dont understand a thing at all Any input apriciated. Best regards Søren -Oprindelig meddelelse- Fra: David Rosenstrauch [mailto:[EMAIL PROTECTED]] Sendt: 6. november 2001 08:24 Til: [EMAIL PROTECTED] Emne: Fwd: Re: Newbie XSP question - why dosn't this work? Søren, OK. Problem solved. Frank was right. util:include-expr is the way to go. It will parse the text that you pass in to it, and generate SAX calls from it (as opposed to writing the text straight to the output - after escaping all the control chars - like it's doing now). I've attached: * test.xsp, which is the solution to your problem but using test data (you should be able to easily adapt it to your needs), and * test.xml, which is the output that proves this works. Note: 1) You must include the namespace xmlns:util=http://apache.org/xsp/util/2.0; in your XSP or the util:include-expr won't get called properly. 2) the super-nested call you need to make this work: util:include-exprutil:exprxsp:exprs/xsp:expr/util:expr/util:inclu de-expr xsp:exprs/xsp:expr takes the value of String s, which is then passed in to util:include-expr. This should solve your problem. Email if not. DR From: Frank Taffelt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Newbie XSP question - why dosn't this work? Date: Tue, 6 Nov 2001 10:17:03 +0100 sorry i sent you the right in the wrong syntax. the code to embed your String is: util:include-exprutil:exprmsg/util:expr /util:include-expr alternatively you can let your ContactBO return either an * org.w3c.dom.Node that represents your BO in a DOM * object that implements org.apache.cocoon.xml.XMLizable for generating SAX-Events according to your BO-Data hth, frank - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.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/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: Re: Newbie XSP question - why dosn't this work?
I... What... But... Ok tjeck this one out (this will probably not make any sence to people new to this thread): I have my old Java object that returns XML to my logicsheet. This object can return a lot of different XML, depending on what parameters it get (my super duper framework - joke). Now I have two different XML outputs on two different URL's. Each work just fine, C2 processes my XML just fine. But if I hit XML1-URL C2 processes the XML, and if I then hit XML2-URL reight thereafter it prints out the XML (my old problem returns), and I have to restart C2 to get XML2-URL to work correctly. And vise versa if I start by hitting XML2-URL (after a restart) it works but then XML1-URL fails (yes the old XML-printout problem again again). Are you confused, I know I am. I dont understand a thing at all Any input apriciated. Best regards Søren -Oprindelig meddelelse- Fra: David Rosenstrauch [mailto:[EMAIL PROTECTED]] Sendt: 6. november 2001 08:24 Til: [EMAIL PROTECTED] Emne: Fwd: Re: Newbie XSP question - why dosn't this work? Søren, OK. Problem solved. Frank was right. util:include-expr is the way to go. It will parse the text that you pass in to it, and generate SAX calls from it (as opposed to writing the text straight to the output - after escaping all the control chars - like it's doing now). I've attached: * test.xsp, which is the solution to your problem but using test data (you should be able to easily adapt it to your needs), and * test.xml, which is the output that proves this works. Note: 1) You must include the namespace xmlns:util=http://apache.org/xsp/util/2.0; in your XSP or the util:include-expr won't get called properly. 2) the super-nested call you need to make this work: util:include-exprutil:exprxsp:exprs/xsp:expr/util:expr/util:inclu de-expr xsp:exprs/xsp:expr takes the value of String s, which is then passed in to util:include-expr. This should solve your problem. Email if not. DR From: Frank Taffelt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Newbie XSP question - why dosn't this work? Date: Tue, 6 Nov 2001 10:17:03 +0100 sorry i sent you the right in the wrong syntax. the code to embed your String is: util:include-exprutil:exprmsg/util:expr /util:include-expr alternatively you can let your ContactBO return either an * org.w3c.dom.Node that represents your BO in a DOM * object that implements org.apache.cocoon.xml.XMLizable for generating SAX-Events according to your BO-Data hth, frank - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.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/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie XSP question - why dosn't this work?
I think either of these will work: xsp:logic![CDATA[ String msg = ContactBO.getContacts(xsl:value-of select=pim:nummer/); ]]/xsp:logic or xsp:logic String msg = ContactBO.getContacts(lt;xsl:value-of select=pim:nummer/gt;); /xsp:logic If not, I'll try to come up with another solution. DR At 02:24 PM 11/2/01 -0800, you wrote: Long time I had time to look at this, but I still have the problem. My problem is not getting the parameter to the Java method, but the fact that the XML returned from my method (msg) is escaped/encoded so that , and so on is escaped to something quite useless. I have attached my original post! Please help me :) -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sendt: 12. oktober 2001 04:41 Til: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Emne: Re: SV: Newbie XSP question - why dosn't this work? Hi Søren, On Fri, 12 Oct 2001, Søren Neigaard wrote: xsp:logic String msg = ContactBO.getContacts( xsl:value-of select=pim:nummer/ !-- osv, hvis der er andre parametre -- ); System.out.println(\n--- XML returned from BO:\n); System.out.println(msg); System.out.println(\n---\n); /xsp:logic Are you sure you want to what you are doing with the -s? I am a complete newbie on this, but it seems to me that the Java part of things would get into problems with the 4 -s up there... you'd have to do some escaping of them, ie. String msg = ContactBO.getContacts( xsl:value-of select=\pim:nummer\/ ); Hope that works... Sincerely, Jan -- Mr. Jan-Aage Bruvoll IT Project Manager 20 Min Holding, Thurgauerstrasse 40, CH-8050 Zurich Zurich office: +41 1 307 4293, fax: +41 1 307 4281 Office/fax: +44 2072408283 Mobile: +44 7740291600 - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.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/faqs.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/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie XSP question - why dosn't this work?
Long time I had time to look at this, but I still have the problem. My problem is not getting the parameter to the Java method, but the fact that the XML returned from my method (msg) is escaped/encoded so that , and so on is escaped to something quite useless. I have attached my original post! Please help me :) -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sendt: 12. oktober 2001 04:41 Til: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Emne: Re: SV: Newbie XSP question - why dosn't this work? Hi Søren, On Fri, 12 Oct 2001, Søren Neigaard wrote: xsp:logic String msg = ContactBO.getContacts( xsl:value-of select=pim:nummer/ !-- osv, hvis der er andre parametre -- ); System.out.println(\n--- XML returned from BO:\n); System.out.println(msg); System.out.println(\n---\n); /xsp:logic Are you sure you want to what you are doing with the -s? I am a complete newbie on this, but it seems to me that the Java part of things would get into problems with the 4 -s up there... you'd have to do some escaping of them, ie. String msg = ContactBO.getContacts( xsl:value-of select=\pim:nummer\/ ); Hope that works... Sincerely, Jan -- Mr. Jan-Aage Bruvoll IT Project Manager 20 Min Holding, Thurgauerstrasse 40, CH-8050 Zurich Zurich office: +41 1 307 4293, fax: +41 1 307 4281 Office/fax: +44 2072408283 Mobile: +44 7740291600 - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] I have a XSP, a XSL and a logicsheet. Everything works fine, but one thing. My logicsheet returns XML, but it encodes the and the . Why and what can I do to prevent this? Here is my logicsheet: ?xml version=1.0 encoding=ISO-8859-1? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:xsp=http://apache.org/xsp; xmlns:pim=http://www.mobilethink.dk/pim; xsl:output encoding=ISO-8859-1 indent=yes method=xml/ xsl:template match=xsp:page xsp:page xsl:apply-templates select=@*/ xsp:structure xsp:includejava.util.*/xsp:include xsp:includedk.mobilethink.test.businessobjects.*/xsp:include /xsp:structure xsl:apply-templates/ /xsp:page /xsl:template xsl:template match=pim:kontaktpersoner xsp:logic String msg = ContactBO.getContacts( xsl:value-of select=pim:nummer/ ); System.out.println(msg); /xsp:logic xsp:exprmsg/xsp:expr /xsl:template xsl:template match=@*|*|text()|processing-instruction() priority=-1 xsl:copy xsl:apply-templates select=@*|*|text()|processing-instruction()/ /xsl:copy /xsl:template /xsl:stylesheet - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
XSP Question
Hi I've hit a problem with XSP which I can't find an answer to and would really appreciate some help as I've spent hours trying to figure out why I can't get XSP to work. I've installed Cocoon 1.8.2 under Tomcat 3.2.3 itself under Apache 1.3.2 (using the mod_jk plug in rather than Jserv) under Windows ME. I start up Apache and then Tomcat and type in http://localhost:8080/Cocoon.xml in IE 5.5 (I also have Microsoft's msxml3 parser installed) and I get the output page. I can also get an xml page that I had formatted with an associated xsl style sheet to output as html. However when I try to view an xsp page I don't get the right output. For example when I tried the page.xml sample provided with Cocoon all I got as output was the following type = "txt\html" followed by Copyright © 1999-2001 The Apache XML Project. All rights reserved between two horizontal rules itself followed by and #f0f0f0 #ff #f0f0f0 #ff. I really need some help on this as I'm using Cocoon as I'm now at a loss as to wht to try next. Thanks in anticipation Marc Cattini
[c2.1] xsp question and a sitemap question
1. it's quite simple. i want to pass parameters to my xsp page from my sitemap. the typical modus operandi is to do this: map:generate src=content/product.xml type=serverpages map:parameter name=foo value=bar/ /map:generate but how do i access the parameter from my xsp page? actions are given a Parameters object, but xsp pages are not, and i don't know how to access the Parameters from the objectModel. 2. i want to add a couple of http response headers to a sitemap resource pipeline: map:match pattern=header map:generate src=content/header.xml type=serverpages/ map:transform src=style/header2svg.xsl/ map:serialize type=svg2jpeg/ /map:match i want to give it a Pragma: No-cache HTTP header so that the client will refetch the resource every time. are there parameters i can pass to the serializer so that it will add HTTP headers (assuming it subclasses AbstractSerializer or whatever)? If not, would anyone oppose that addition? - donald - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]