Cocoon 2.2 and sendmail
Hi, I'm trying send email with Cocoon 2.2. So, I have in my pom.xml the dependency : dependency groupIdorg.apache.cocoon/groupId artifactIdcocoon-mail-impl/artifactId version1.0.0/version /dependency and in my sitemap.xmap, I have my tramsformer sendmail : map:transformer name=sendmail src=org.apache.cocoon.mail.transformation.SendMailTransformer/ and a pipeline for my test : map:match pattern=sendmail map:generate src=xdocs/sendmail.xml/ map:transform src=stylesheets/sendmail.xsl map:parameter name=name value={request-param:name}/ map:parameter name=email value={request-param:email}/ map:parameter name=id value={session:id}/ /map:transform map:serialize type=xml/ /map:match I'm sure that my params are good :) But then I send an email, I have nothing in my email box !!! So, I can read (on http://cocoon.apache.org/2.2/blocks/mail/1.0/1099_1_1.html) NOTE: The SendMailTransformer needs the JavaMail[1] and JavaBeans Activation Framework (JAF)[2] API's from Sun to work. Add them to WEB-INF/lib. Remove geronimo-spec-javamail-*.jar and geronimo-spec-activation-*.jar from WEB-INF/lib. but I don't have a repertory WEB-INF/lib, I have just a COB-INF and META-INF ! Have you got an idea ? Where can I put my .jar ? Thanks G. R. www.polymorphisme.com webmas...@polymorphisme.org fixe : +33 (0)5.24.07.64.02 port : +33 (0)6.89.54.14.84 Liens: -- [1] http://java.sun.com/products/javamail/ [2] http://java.sun.com/products/javabeans/glasgow/jaf.html
Re: Cocoon 2.2 and sendmail
Hi! Did you check that the jars you mention are not included over the dependency cocoon-mail-impl? If not, you could add these dependencies in your pom, then you should get them in your build. -- Med vennlig hilsen / kind regards Søren D. Krum Systemutvikler/system developer UNINETT FAS + 47 73557859 There are 10 different kind of people in the world, those who understand binary and those who don't - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Cocoon 2.2 and sendmail
2011/5/9 Grégory Roche webmas...@polymorphisme.org: I'm trying send email with Cocoon 2.2. ... and in my sitemap.xmap, I have my tramsformer sendmail : map:transformer name=sendmail src=org.apache.cocoon.mail.transformation.SendMailTransformer/ and a pipeline for my test : map:match pattern=sendmail map:generate src=xdocs/sendmail.xml/ map:transform src=stylesheets/sendmail.xsl map:parameter name=name value={request-param:name}/ map:parameter name=email value={request-param:email}/ map:parameter name=id value={session:id}/ /map:transform map:serialize type=xml/ /map:match I'm sure that my params are good :) But then I send an email, I have nothing in my email box !!! Maybe I'm missing something here, but you don't appear to have called the sendmail transformer - the pipeline you quoted only has a generator, xslt transformation and xml serialiser...? Andy -- http://pseudoq.sourceforge.net/ - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Cocoon 2.2 and sendmail
So, I have change my pipeline ! I add the transformer for the emails : map:match pattern=sendmail map:generate src=xdocs/sendmail.xml/ map:transform src=stylesheets/sendmail.xsl map:parameter name=name value={request-param:name}/ map:parameter name=email value={request-param:email}/ map:parameter name=id value={session:id}/ /map:transform map:transform type=sendmail/ map:serialize type=xml/ /map:match That it's good :) But then I send an email, I have the reponce : :result xmlns=http://apache.org/cocoon/transformation/sendmail; :failure to=webmas...@polymorphisme.orgInvalid address/:failure /:result And my adresse email webmas...@polymorphisme.org is valide. I don't know what is the problem ! Thanks. G R www.polymorphisme.com webmas...@polymorphisme.org fixe : +33 (0)5.24.07.64.02 port : +33 (0)6.89.54.14.84Andy Stevens insomniacpeng...@googlemail.com a écrit : 2011/5/9 Grégory Roche webmas...@polymorphisme.org: I'm trying send email with Cocoon 2.2. ... and in my sitemap.xmap, I have my tramsformer sendmail : map:transformer name=sendmail src=org.apache.cocoon.mail.transformation.SendMailTransformer/ and a pipeline for my test : map:match pattern=sendmail map:generate src=xdocs/sendmail.xml/ map:transform src=stylesheets/sendmail.xsl map:parameter name=name value={request-param:name}/ map:parameter name=email value={request-param:email}/ map:parameter name=id value={session:id}/ /map:transform map:serialize type=xml/ /map:match I'm sure that my params are good :) But then I send an email, I have nothing in my email box !!! Maybe I'm missing something here, but you don't appear to have called the sendmail transformer - the pipeline you quoted only has a generator, xslt transformation and xml serialiser...? Andy -- http://pseudoq.sourceforge.net/
Re: Cocoon 2.2 and sendmail
What mail server host are you sending the mail through? Perhaps it's set up to prevent relaying and your message is being rejected because of the address(es) involved? Andy -- http://pseudoq.sourceforge.net/ On 9 May 2011 09:19, Grégory Roche webmas...@polymorphisme.org wrote: So, I have change my pipeline ! I add the transformer for the emails : map:match pattern=sendmail map:generate src=xdocs/sendmail.xml/ map:transform src=stylesheets/sendmail.xsl map:parameter name=name value={request-param:name}/ map:parameter name=email value={request-param:email}/ map:parameter name=id value={session:id}/ /map:transform map:transform type=sendmail/ map:serialize type=xml/ /map:match That it's good :) But then I send an email, I have the reponce : :result xmlns=http://apache.org/cocoon/transformation/sendmail; :failure to=webmas...@polymorphisme.orgInvalid address/:failure /:result And my adresse email webmas...@polymorphisme.org is valide. I don't know what is the problem ! Thanks. G R www.polymorphisme.com webmas...@polymorphisme.org fixe : +33 (0)5.24.07.64.02 port : +33 (0)6.89.54.14.84Andy Stevens insomniacpeng...@googlemail.com a écrit : 2011/5/9 Grégory Roche webmas...@polymorphisme.org: I'm trying send email with Cocoon 2.2. ... and in my sitemap.xmap, I have my tramsformer sendmail : map:transformer name=sendmail src=org.apache.cocoon.mail.transformation.SendMailTransformer/ and a pipeline for my test : map:match pattern=sendmail map:generate src=xdocs/sendmail.xml/ map:transform src=stylesheets/sendmail.xsl map:parameter name=name value={request-param:name}/ map:parameter name=email value={request-param:email}/ map:parameter name=id value={session:id}/ /map:transform map:serialize type=xml/ /map:match I'm sure that my params are good :) But then I send an email, I have nothing in my email box !!! Maybe I'm missing something here, but you don't appear to have called the sendmail transformer - the pipeline you quoted only has a generator, xslt transformation and xml serialiser...? Andy -- http://pseudoq.sourceforge.net/
Re: Cocoon 2.2 and sendmail
One way to find out what is happening is to remove (comment out) the map:transform type=sendmail/ and have a look at the generated XML e.g. in your browser with: http://foo.bar.com/sendmail?name=rocheemail=webmas...@polymorphisme.org There may be just a simple error in the generated XML that sendmail receives. On 09/05/11 11:27, Andy Stevens wrote: What mail server host are you sending the mail through? Perhaps it's set up to prevent relaying and your message is being rejected because of the address(es) involved? Andy -- http://pseudoq.sourceforge.net/ On 9 May 2011 09:19, Grégory Roche webmas...@polymorphisme.org mailto:webmas...@polymorphisme.org wrote: So, I have change my pipeline ! I add the transformer for the emails : map:match pattern=sendmail map:generate src=xdocs/sendmail.xml/ map:transform src=stylesheets/sendmail.xsl map:parameter name=name value={request-param:name}/ map:parameter name=email value={request-param:email}/ map:parameter name=id value={session:id}/ /map:transform map:transform type=sendmail/ map:serialize type=xml/ /map:match That it's good :) But then I send an email, I have the reponce : :result xmlns=http://apache.org/cocoon/transformation/sendmail; :failure to=webmas...@polymorphisme.org mailto:webmas...@polymorphisme.orgInvalid address/:failure /:result And my adresse email webmas...@polymorphisme.org mailto:webmas...@polymorphisme.org is valide. I don't know what is the problem ! Thanks. G R www.polymorphisme.com http://www.polymorphisme.com webmas...@polymorphisme.org mailto:webmas...@polymorphisme.org fixe : +33 (0)5.24.07.64.02 port : +33 (0)6.89.54.14.84Andy Stevens insomniacpeng...@googlemail.com mailto:insomniacpeng...@googlemail.com a écrit : 2011/5/9 Grégory Roche webmas...@polymorphisme.org mailto:webmas...@polymorphisme.org: I'm trying send email with Cocoon 2.2. ... and in my sitemap.xmap, I have my tramsformer sendmail : map:transformer name=sendmail src=org.apache.cocoon.mail.transformation.SendMailTransformer/ and a pipeline for my test : map:match pattern=sendmail map:generate src=xdocs/sendmail.xml/ map:transform src=stylesheets/sendmail.xsl map:parameter name=name value={request-param:name}/ map:parameter name=email value={request-param:email}/ map:parameter name=id value={session:id}/ /map:transform map:serialize type=xml/ /map:match I'm sure that my params are good :) But then I send an email, I have nothing in my email box !!! Maybe I'm missing something here, but you don't appear to have called the sendmail transformer - the pipeline you quoted only has a generator, xslt transformation and xml serialiser...? Andy -- http://pseudoq.sourceforge.net/ -- Andre H. Juffer | Phone: +358-8-553 1161 Biocenter Oulu and | Fax: +358-8-553-1141 Department of Biochemistry | Email: andre.juf...@oulu.fi University of Oulu, Finland | WWW: www.biochem.oulu.fi/Biocomputing/ StrucBioCat | WWW: www.strucbiocat.oulu.fi Triacle Biocomputing | WWW: www.triacle-bc.com
Re: Cocoon 2.2 and sendmail
Ok, now, I have a minimal pipeline : map:match pattern=sendmail map:generate src=xdocs/sendmail.xml/ map:transform type=sendmail/ map:serialize type=xml/ /map:match and my file sendmail.xml (an exemple is on the page http://cocoon.apache.org/2.2/blocks/mail/1.0/1099_1_1.html) : ?xml version=1.0 encoding=UTF-8? document xmlns:email=http://apache.org/cocoon/transformation/sendmail; email:sendmail email:smtphostsmtp.polymorphisme.org/email:smtphost email:smtpport25/email:smtpport email:fromwebmas...@polymorphisme.org/email:from email:towebmas...@polymorphisme.org/email:to email:subjectsubject/email:subject email:bodybody/email:body /email:sendmail /document And with my navigator I open URL : http://localhost:/admin/sendmail but he returns : ?xml version=1.0 encoding=UTF-8? document xmlns:email=http://apache.org/cocoon/transformation/sendmail; email:result email:failure to=webmas...@polymorphisme.orgInvalid address/email:failure /email:result /document It's more funny, but I don't understand why I can't to receve my email, my email adress is valid ! Thank for you help. Grégory Roche www.polymorphisme.com webmas...@polymorphisme.org fixe : +33 (0)5.24.07.64.02 port : +33 (0)6.89.54.14.84Andre Juffer andre.juf...@oulu.fi a écrit : One way to find out what is happening is to remove (comment out) the map:transform type=sendmail/ and have a look at the generated XML e.g. in your browser with: http://foo.bar.com/sendmail?name=rocheemail=webmas...@polymorphisme.org There may be just a simple error in the generated XML that sendmail receives. On 09/05/11 11:27, Andy Stevens wrote: What mail server host are you sending the mail through? Perhaps it's set up to prevent relaying and your message is being rejected because of the address(es) involved? Andy -- http://pseudoq.sourceforge.net/ On 9 May 2011 09:19, Grégory Roche webmas...@polymorphisme.org mailto:webmas...@polymorphisme.org wrote: So, I have change my pipeline ! I add the transformer for the emails : map:match pattern=sendmail map:generate src=xdocs/sendmail.xml/ map:transform src=stylesheets/sendmail.xsl map:parameter name=name value={request-param:name}/ map:parameter name=email value={request-param:email}/ map:parameter name=id value={session:id}/ /map:transform map:transform type=sendmail/ map:serialize type=xml/ /map:match That it's good :) But then I send an email, I have the reponce : :result xmlns=http://apache.org/cocoon/transformation/sendmail; :failure to=webmas...@polymorphisme.org mailto:webmas...@polymorphisme.orgInvalid address/:failure /:result And my adresse email webmas...@polymorphisme.org mailto:webmas...@polymorphisme.org is valide. I don't know what is the problem ! Thanks. G R www.polymorphisme.com http://www.polymorphisme.com webmas...@polymorphisme.org mailto:webmas...@polymorphisme.org fixe : +33 (0)5.24.07.64.02 port : +33 (0)6.89.54.14.84Andy Stevens insomniacpeng...@googlemail.com mailto:insomniacpeng...@googlemail.com a écrit : 2011/5/9 Grégory Roche webmas...@polymorphisme.org mailto:webmas...@polymorphisme.org: I'm trying send email with Cocoon 2.2. ... and in my sitemap.xmap, I have my tramsformer sendmail : map:transformer name=sendmail src=org.apache.cocoon.mail.transformation.SendMailTransformer/ and a pipeline for my test : map:match pattern=sendmail map:generate src=xdocs/sendmail.xml/ map:transform src=stylesheets/sendmail.xsl map:parameter name=name value={request-param:name}/ map:parameter name=email value={request-param:email}/ map:parameter name=id value={session:id}/ /map:transform map:serialize type=xml/ /map:match I'm sure that my params are good :) But then I send an email, I have nothing in my email box !!! Maybe I'm missing something here, but you don't appear to have called the sendmail transformer - the pipeline you quoted only has a generator, xslt transformation and xml serialiser...? Andy -- http://pseudoq.sourceforge.net/ -- Andre H. Juffer | Phone: +358-8-553 1161 Biocenter Oulu and | Fax: +358-8-553-1141 Department of Biochemistry | Email: andre.juf...@oulu.fi University of Oulu, Finland | WWW: www.biochem.oulu.fi/Biocomputing/ StrucBioCat | WWW: www.strucbiocat.oulu.fi Triacle Biocomputing | WWW: www.triacle-bc.com
Re: Cocoon 2.2 and sendmail
The generated XML seems fine. Possible, the Invalid address message is a response from smtp.polymorphisme.org. It may be that the email address itself is OK, but the protocol for accepting emails is wrong. Port 25 suggests that you assume no connection security and no authentication either. That is correct? If you send it from a machine outside the domain polymorphisme.org, it may be that your email is simply not accepted by the SMTP. If so, you would need to use the local sendmail (on unix/Linux boxes at least). On 09/05/11 11:59, Grégory Roche wrote: Ok, now, I have a minimal pipeline : map:match pattern=sendmail map:generate src=xdocs/sendmail.xml/ map:transform type=sendmail/ map:serialize type=xml/ /map:match and my file sendmail.xml (an exemple is on the page http://cocoon.apache.org/2.2/blocks/mail/1.0/1099_1_1.html) : ?xml version=1.0 encoding=UTF-8? document xmlns:email=http://apache.org/cocoon/transformation/sendmail; email:sendmail email:smtphostsmtp.polymorphisme.org/email:smtphost email:smtpport25/email:smtpport email:fromwebmas...@polymorphisme.org/email:from email:towebmas...@polymorphisme.org/email:to email:subjectsubject/email:subject email:bodybody/email:body /email:sendmail /document And with my navigator I open URL : http://localhost:/admin/sendmail but he returns : ?xml version=1.0 encoding=UTF-8? documentxmlns:email=http://apache.org/cocoon/transformation/sendmail; email:result email:failureto=webmas...@polymorphisme.orgInvalid address/email:failure /email:result /document It's more funny, but I don't understand why I can't to receve my email, my email adress is valid ! Thank for you help. Grégory Roche www.polymorphisme.com webmas...@polymorphisme.org fixe : +33 (0)5.24.07.64.02 port : +33 (0)6.89.54.14.84 Andre Juffer andre.juf...@oulu.fi a écrit : One way to find out what is happening is to remove (comment out) the map:transform type=sendmail/ and have a look at the generated XML e.g. in your browser with: http://foo.bar.com/sendmail?name=rocheemail=webmas...@polymorphisme.org http://foo.bar.com/sendmail?name=rocheemail=webmas...@polymorphisme.org There may be just a simple error in the generated XML that sendmail receives. On 09/05/11 11:27, Andy Stevens wrote: What mail server host are you sending the mail through? Perhaps it's set up to prevent relaying and your message is being rejected because of the address(es) involved? Andy -- http://pseudoq.sourceforge.net/ On 9 May 2011 09:19, Grégory Roche webmas...@polymorphisme.org mailto:webmas...@polymorphisme.org wrote: So, I have change my pipeline ! I add the transformer for the emails : map:match pattern=sendmail map:generate src=xdocs/sendmail.xml/ map:transform src=stylesheets/sendmail.xsl map:parameter name=name value={request-param:name}/ map:parameter name=email value={request-param:email}/ map:parameter name=id value={session:id}/ /map:transform map:transform type=sendmail/ map:serialize type=xml/ /map:match That it's good :) But then I send an email, I have the reponce : :result xmlns=http://apache.org/cocoon/transformation/sendmail; :failure to=webmas...@polymorphisme.org mailto:webmas...@polymorphisme.orgInvalid address/:failure /:result And my adresse email webmas...@polymorphisme.org mailto:webmas...@polymorphisme.org is valide. I don't know what is the problem ! Thanks. G R www.polymorphisme.com http://www.polymorphisme.com webmas...@polymorphisme.org mailto:webmas...@polymorphisme.org fixe : +33 (0)5.24.07.64.02 port : +33 (0)6.89.54.14.84Andy Stevens insomniacpeng...@googlemail.com mailto:insomniacpeng...@googlemail.com a écrit : 2011/5/9 Grégory Roche webmas...@polymorphisme.org mailto:webmas...@polymorphisme.org: I'm trying send email with Cocoon 2.2. ... and in my sitemap.xmap, I have my tramsformer sendmail : map:transformer name=sendmail src=org.apache.cocoon.mail.transformation.SendMailTransformer/ and a pipeline for my test : map:match pattern=sendmail map:generate src=xdocs/sendmail.xml/ map:transform src=stylesheets/sendmail.xsl map:parameter name=name value={request-param:name}/ map:parameter name=email value={request-param:email}/ map:parameter name=id value={session:id}/ /map:transform map:serialize type=xml/ /map:match I'm sure that my params are good :) But then I send an email, I have nothing in my email box !!! Maybe I'm missing something here, but you don't appear to have called the sendmail transformer - the pipeline you quoted only has a generator, xslt transformation and xml serialiser...? Andy -- http://pseudoq.sourceforge.net/ -- Andre H. Juffer | Phone: +358-8-553 1161 Biocenter Oulu and | Fax: +358-8-553-1141 Department of Biochemistry | Email: andre.juf...@oulu.fi University of Oulu, Finland | WWW: www.biochem.oulu.fi/Biocomputing/ StrucBioCat | WWW: www.strucbiocat.oulu.fi Triacle Biocomputing
Detecting mobile browsers and redirecting
I also posted this question to http://stackoverflow.com/questions/5849929/how-do-i-configure-cocoon-to-redirect-mobile-browsers-to-a-mobile-site StackOverflow : I have two Cocoon sites: ABC and ABC-mobile. If the user is coming from a mobile browser, then I want them redirected to ABC-mobile. How do I accomplish this? -- View this message in context: http://old.nabble.com/Detecting-mobile-browsers-and-redirecting-tp31576154p31576154.html Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Detecting mobile browsers and redirecting
Hi, May have a look to this : http://cocoon.apache.org/2.1/userdocs/browser-selector.html ++ On 05/09/2011 02:02 PM, Mike Sickler wrote: I also posted this question to http://stackoverflow.com/questions/5849929/how-do-i-configure-cocoon-to-redirect-mobile-browsers-to-a-mobile-site StackOverflow : I have two Cocoon sites: ABC and ABC-mobile. If the user is coming from a mobile browser, then I want them redirected to ABC-mobile. How do I accomplish this? - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Detecting mobile browsers and redirecting
Am 09.05.11 14:02, schrieb Mike Sickler: I also posted this question to http://stackoverflow.com/questions/5849929/how-do-i-configure-cocoon-to-redirect-mobile-browsers-to-a-mobile-site StackOverflow : I have two Cocoon sites: ABC and ABC-mobile. If the user is coming from a mobile browser, then I want them redirected to ABC-mobile. How do I accomplish this? http://wurfl.sourceforge.net/njava/ We used this in an application based on Cocoon 2.1. The redirect is determined using a custom Selector. You can use the code example from the website. HTH, -- Andreas -- Andreas Hartmann, CTO BeCompany GmbH http://www.becompany.ch Tel.: +41 (0) 43 818 57 01 - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Detecting mobile browsers and redirecting
Hi, DeviceCompass offers a Cocoon 2.2 Block to do this. You can choose not only the browser type but also any device criteria to redirect to your mobile page. http://www.devicecompass.com/en/docs/compass-cocoon-block Regards Ali Am 09.05.2011 um 14:02 schrieb Mike Sickler: I also posted this question to http://stackoverflow.com/questions/5849929/how-do-i-configure-cocoon-to-redirect-mobile-browsers-to-a-mobile-site StackOverflow : I have two Cocoon sites: ABC and ABC-mobile. If the user is coming from a mobile browser, then I want them redirected to ABC-mobile. How do I accomplish this? -- View this message in context: http://old.nabble.com/Detecting-mobile-browsers-and-redirecting-tp31576154p31576154.html Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Cocoon caching with multiple pipelines
Hi Robin, Am 27.04.11 12:49, schrieb Robin Taylor: It looks like the default generator is an extension of FileGenerator that I assume takes as input the output from themap:serialize type=xml/ step in the preceding pipeline. what do you mean with preceding pipeline? What exactly does the custom FileGenerator use as the source? A hard-coded cocoon:/ call? I also assume therefore that the FileGenerator uses the incoming xml to build its validity object and therefore spots that it has changed ? No, the standard FileGenerator uses the validity of the source. The incoming XML cannot be used, since it would have to be re-generated to spot changes, which kind-of renders the caching mechanism useless. Typical source validities are based on last modification dates, expiration times and similar concepts. Example: If you pass a file URI to the FileGenerator, the last modification date of the file is used. If you pass a cocoon:/ URI to the generator, the validity of the corresponding SitemapSource (representing the result of the called pipeline) is used. HTH, -- Andreas Thanks again. On Wed, 2011-04-27 at 10:54 +0100, Thorsten Scherler wrote: On Wed, 2011-04-27 at 09:41 +0100, Robin Taylor wrote: Hi Thorsten, Thanks again and apologies for drip-feeding the questions. In the code I'm looking at it appears the second pipeline has an empty map:generate ie.map:generate/. I assume this results in the second pipeline using the output from the first pipeline. no, amap:generate/ means cocoon uses the default generator configured for this sitemap. If is does not uses a src is most likely a special generator such as e.g. http://cocoon.apache.org/2.1/userdocs/request-generator.html Using that as an example: map:generators default=request !-- This will turn on attribute generation on by default -- map:generator name=request src=org.apache.cocoon.generation.RequestGenerator map:parameter name=generate-attributes value=true/ /map:generator /map:generators ... !-- This will turn on attribute generation for this invocation only. -- map:match pattern=request map:generate/ map:serialize/ /map:match As you see themap:generate/ would here generate a xml representation of the request and not use a former match/pipeline as input. salu2 -- Andreas Hartmann, CTO BeCompany GmbH http://www.becompany.ch Tel.: +41 (0) 43 818 57 01 - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: validating xml
Hi Robby, Am 14.04.11 13:43, schrieb Robby Pelssers: Hi all, i've got an interesting use case where my starting point is XML data (could be 1 single file, aggregated xml data, xquery results, ...) From this input I have to generate a DITA map and topics for which I have a map.dtd and topic.dtd which I can use for validation purposes. At some point in time during all transformation steps I have something like below simplified snippet immediately before I want to use the source-writing transformer. I need to validate the map and topics before writing the files to disc. Root map.../map topic.../topic topic.../topic ... /Root I can't simply use the approach below map:transform src=schemas/topic.xsd type=validate/ (similar for map) since I still have an aggregated situation. Did anyone ever have a similar situation and a solution for this? Ideally the org.apache.cocoon.transformation.ValidatingTransformer could handle an optional xpath expression to specify which nodes to treat as rootnodes for validation. Would this approach work? yes, I assume that this approach would work. A relatively simple alternative would be to modularize the page generation. The drawback is probably a decreased performance, especially when generating the initial XML is expensive. 1. Transform the initial XML data into an XML structure containing include tags for the single fragments which need to be validated (map, topic etc.) 2. The include transformation calls a separate pipeline for each fragment type; these pipelines contain the validation transformation step. Unfortunately, the initial XML needs to be re-generated in each of these calls. Maybe this works for you? Best regards, Andreas -- Andreas Hartmann, CTO BeCompany GmbH http://www.becompany.ch Tel.: +41 (0) 43 818 57 01 - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
RE: validating xml
Hi Andreas, your suggestion would of course work and i did consider it as a non-preferred solution. To answer your question: I don't have to generate the input myself. The original xml input comes from filesystem or an xml database so it's just fetching the file but in my case i would have to fetch the file up to 10 times in some cases (map with lots of topics). I did not yet try how this will affect performance but I could give it a try. Thx for thinking along. Robby -Oorspronkelijk bericht- Van: Andreas Hartmann [mailto:andr...@apache.org] Verzonden: ma 9-5-2011 15:37 Aan: users@cocoon.apache.org Onderwerp: Re: validating xml Hi Robby, Am 14.04.11 13:43, schrieb Robby Pelssers: Hi all, i've got an interesting use case where my starting point is XML data (could be 1 single file, aggregated xml data, xquery results, ...) From this input I have to generate a DITA map and topics for which I have a map.dtd and topic.dtd which I can use for validation purposes. At some point in time during all transformation steps I have something like below simplified snippet immediately before I want to use the source-writing transformer. I need to validate the map and topics before writing the files to disc. Root map.../map topic.../topic topic.../topic ... /Root I can't simply use the approach below map:transform src=schemas/topic.xsd type=validate/ (similar for map) since I still have an aggregated situation. Did anyone ever have a similar situation and a solution for this? Ideally the org.apache.cocoon.transformation.ValidatingTransformer could handle an optional xpath expression to specify which nodes to treat as rootnodes for validation. Would this approach work? yes, I assume that this approach would work. A relatively simple alternative would be to modularize the page generation. The drawback is probably a decreased performance, especially when generating the initial XML is expensive. 1. Transform the initial XML data into an XML structure containing include tags for the single fragments which need to be validated (map, topic etc.) 2. The include transformation calls a separate pipeline for each fragment type; these pipelines contain the validation transformation step. Unfortunately, the initial XML needs to be re-generated in each of these calls. Maybe this works for you? Best regards, Andreas -- Andreas Hartmann, CTO BeCompany GmbH http://www.becompany.ch Tel.: +41 (0) 43 818 57 01 - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org winmail.dat - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org