xsl question
How would I do an if statement in xsl were I am testing for the value of an element? Example xsl:if test=deviation = 1 . where my incoming xml looks like this: de deviation0/deviation compleated-byN/A/compleated-by Thanks for the help Tim Bachta - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: xsl question
You should ask [EMAIL PROTECTED] They are really good on xsl questions. xsl:if test=deviation ='1' Charlene -Original Message- From: Joydeep Bose [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 12:49 PM To: [EMAIL PROTECTED]; Tim Bachta Subject: Re: xsl question To be on the safer side put the fully qualified element: eg test=/page/deviation = 1 unless the if statement is in a for-each or something that selects the parent node of the deviation element.Then just deviation is fine. Quoting Tim Bachta [EMAIL PROTECTED]: How would I do an if statement in xsl were I am testing for the value of an element? Example xsl:if test=deviation = 1 . where my incoming xml looks like this: de deviation0/deviation compleated-byN/A/compleated-by Thanks for the help Tim Bachta - 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]
xsl question
Hi, I have an xml file as follows: user userid100/userid /user My XSL file is as follows: xsl:template match=user html /body a href=/cocoon/hello?userid=100Menu/a /body /html /xsl:template Now my xsl file has a static URL.But I need a dynamic URL.Each and everytime when my userid changes in the xml file my stylesheet should get the userid from the xml file.How should my stylesheet look like in that case?If someoneknows please help me. Kavitha. __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: xsl question
From: Kavitha Ramesh [mailto:[EMAIL PROTECTED]] Please do not ask pure XSLT questions here. Take a look at XSLT specific mail lists. Hi, I have an xml file as follows: user userid100/userid /user My XSL file is as follows: xsl:template match=user html /body a href=/cocoon/hello?userid=100Menu/a a href=/cocoon/hello?userid={@userid}Menu/a This should help. Konstantin /body /html /xsl:template Now my xsl file has a static URL.But I need a dynamic URL.Each and everytime when my userid changes in the xml file my stylesheet should get the userid from the xml file.How should my stylesheet look like in that case?If someoneknows please help me. Kavitha. __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: xsl question
From: Piroumian Konstantin [mailto:[EMAIL PROTECTED]] From: Kavitha Ramesh [mailto:[EMAIL PROTECTED]] Please do not ask pure XSLT questions here. Take a look at XSLT specific mail lists. Hi, I have an xml file as follows: user userid100/userid /user My XSL file is as follows: xsl:template match=user html /body a href=/cocoon/hello?userid=100Menu/a a href=/cocoon/hello?userid={@userid}Menu/a Sorry. It should be: a href=/cocoon/hello?userid={userid}Menu/a KP This should help. Konstantin /body /html /xsl:template Now my xsl file has a static URL.But I need a dynamic URL.Each and everytime when my userid changes in the xml file my stylesheet should get the userid from the xml file.How should my stylesheet look like in that case?If someoneknows please help me. Kavitha. __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com - 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: XSL question
*** REPLY SEPARATOR *** On 26.03.2002 at 15:47 Argyn Kuketayev wrote: As I've said before, you can use an action to get params from whereever you need then expose them to sitemap (using returning map in an action). Then you can simply set those params in your trasformer call: map:transform map:param name=yours value={1} / /map:transform -- Konstantin Piroumian [EMAIL PROTECTED] can you give a complete example of how to do that? I have a similar issue, I need to pass parameters from the request into the stylesheet. Hi Argyn, have a look at http://www.cocooncenter.org/cc/documents/resources/request-params/index.html. Greetings, Andreas - 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: XSL-question: sort with parameter
Try this. Here datatypes also are of concern :). xsl:when test=$xsldttype='number' xsl:for-each select=DATALINE/*[name() = $xslcol] xsl:sort select=. data-type=number/ xsl:call-template name = tablerow / /xsl:for-each /xsl:when xsl:when test=$xsldttype='text' xsl:for-each select=DATALINE/*[name() = $xslcol] xsl:sort select=./ xsl:call-template name = tablerow / /xsl:for-each /xsl:when Try to search for examples on www.google.com. Have fun, Leonid Kleiner - Original Message - From: Axel Honfi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 6:22 AM Subject: XSL-question: sort with parameter Hi! I passed a parameter to a stylesheet and I can get the value with xsl:value-of select=$order-by/. But I need to sort data by the value of the parameter like xsl:sort select=$order-by order=ascending/. But with this nothing happens and all other forms I tried also failed. Does anyone know how to work this? Thanks a lot Axel - 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]
XSL-question: sort with parameter
Hi! I passed a parameter to a stylesheet and I can get the value with xsl:value-of select=$order-by/. But I need to sort data by the value of the parameter like xsl:sort select=$order-by order=ascending/. But with this nothing happens and all other forms I tried also failed. Does anyone know how to work this? Thanks a lot Axel - 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: XSL-question: sort with parameter
Hi Axel, You can use something like following: xsl:sort select=child::node()[name()=$order]/ Best regards Roman Axel Honfi wrote: Hi! I passed a parameter to a stylesheet and I can get the value with xsl:value-of select=$order-by/. But I need to sort data by the value of the parameter like xsl:sort select=$order-by order=ascending/. But with this nothing happens and all other forms I tried also failed. Does anyone know how to work this? Thanks a lot Axel - 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: XSL-question: sort with parameter
It's not a very good solution if you have a lot of values for sort, because you need to put one xsl:if tag for any possible value. ?xml version=1.0 encoding=ISO-8859-1? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xsl:parameter name = sort/ xsl:template match=/HELLO xsl:if test = $sort='@K' xsl:apply-templates select=GOODMORNING xsl:sort select=@K/ /xsl:apply-templates /xsl:if xsl:if test = $sort='@H' xsl:apply-templates select=GOODMORNING xsl:sort select=@H/ /xsl:apply-templates /xsl:if /xsl:template xsl:template match=GOODMORNING xsl:value-of select=./ /xsl:template /xsl:stylesheet Axel Honfi wrote: Hi! I passed a parameter to a stylesheet and I can get the value with xsl:value-of select=$order-by/. But I need to sort data by the value of the parameter like xsl:sort select=$order-by order=ascending/. But with this nothing happens and all other forms I tried also failed. Does anyone know how to work this? Thanks a lot Axel - 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] begin:vcard n:Adrover;Bartomeu x-mozilla-html:FALSE org:UIB;Servei de Càlcul i Informatizació version:2.1 email;internet:[EMAIL PROTECTED] adr;quoted-printable:;;Edifici Anselm Turmeda, Campus de la UIB=0D=0ACarretera de Valldemossa Km 7,5 ;Palma de Mallorca;Illes Balears;07071;Espanya fn:Baromeu Adrover end:vcard - 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]
XSL question
Hi, this is a kind of offtopic question I think but anyway... Is there a possibility to pass a parameter to a stylesheet? I'd like to do the following: Given a stylesheet, I'd like to include another but depending on a parameter passed by some external source, say an xml page. thanks in advance. Martin - 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: XSL question
Title: RE: XSL question Yes. There is a tutorial on this at cocooncenter.org: http://www.cocooncenter.de/cc/documents/resources/request-params/index.html -Tom -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 8:56 AM To: [EMAIL PROTECTED] Subject: XSL question Hi, this is a kind of offtopic question I think but anyway... Is there a possibility to pass a parameter to a stylesheet? I'd like to do the following: Given a stylesheet, I'd like to include another but depending on a parameter passed by some external source, say an xml page. thanks in advance. Martin - 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: XSL question
Title: RE: XSL question Hi Thomas, That's a good answer, unfortunately I forgot to point that I'm using Cocoon 1.8.2. Is there a solution for it? thanks! - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 10:53 AM Subject: RE: XSL question Yes. There is a tutorial on this at cocooncenter.org: http://www.cocooncenter.de/cc/documents/resources/request-params/index.html -Tom -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 8:56 AM To: [EMAIL PROTECTED] Subject: XSL question Hi, this is a kind of offtopic question I think but anyway... Is there a possibility to pass a parameter to a stylesheet? I'd like to do the following: Given a stylesheet, I'd like to include another but depending on a parameter passed by some external source, say an xml page. thanks in advance. Martin - 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: XSL question
Title: RE: XSL question Ah, good point. I have no experience with pre 2.x Cocoon, so I don't know what would work. I'm sure others around here can answer that though. -T -Original Message-From: Martin Mauri [mailto:[EMAIL PROTECTED]]Sent: Monday, March 25, 2002 9:07 AMTo: [EMAIL PROTECTED]Subject: Re: XSL question Hi Thomas, That's a good answer, unfortunately I forgot to point that I'm using Cocoon 1.8.2. Is there a solution for it? thanks! - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 10:53 AM Subject: RE: XSL question Yes. There is a tutorial on this at cocooncenter.org: http://www.cocooncenter.de/cc/documents/resources/request-params/index.html -Tom -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 8:56 AM To: [EMAIL PROTECTED] Subject: XSL question Hi, this is a kind of offtopic question I think but anyway... Is there a possibility to pass a parameter to a stylesheet? I'd like to do the following: Given a stylesheet, I'd like to include another but depending on a parameter passed by some external source, say an xml page. thanks in advance. Martin - 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: XSL question
Hi, you need to declare your parameter at the beginiing of the stylesheet : xsl:param name=yourparam/ xsl:template match=/ Then in the body of your stylesheet, $yourparam gives you the value of the parameter. Good luck Alex - 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: XSL question
Title: RE: XSL question A while ago I made an XML (Cocoon 1.8)which requested a parameter passed on from a form on a webpage. Maybe you can try something similar for your XSL? xsp:page language="java"xmlns:sql="http://www.apache.org/1999/SQL"xmlns:xsp="http://www.apache.org/1999/XSP/Core"xmlns:request="http://www.apache.org/1999/XSP/Request" datessql:execute-querysql:querydelete from rooster where uniek='request:get-parameter name="uniek"/'/sql:query/sql:execute-query/dates /xsp:page Regards Richard Korthuis - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 3:13 PM Subject: RE: XSL question Ah, good point. I have no experience with pre 2.x Cocoon, so I don't know what would work. I'm sure others around here can answer that though. -T -Original Message-From: Martin Mauri [mailto:[EMAIL PROTECTED]]Sent: Monday, March 25, 2002 9:07 AMTo: [EMAIL PROTECTED]Subject: Re: XSL question Hi Thomas, That's a good answer, unfortunately I forgot to point that I'm using Cocoon 1.8.2. Is there a solution for it? thanks! - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 10:53 AM Subject: RE: XSL question Yes. There is a tutorial on this at cocooncenter.org: http://www.cocooncenter.de/cc/documents/resources/request-params/index.html -Tom -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 8:56 AM To: [EMAIL PROTECTED] Subject: XSL question Hi, this is a kind of offtopic question I think but anyway... Is there a possibility to pass a parameter to a stylesheet? I'd like to do the following: Given a stylesheet, I'd like to include another but depending on a parameter passed by some external source, say an xml page. thanks in advance. Martin - 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: XSL question
Dear Alexandre, Yes, I already know how to use params, but the point here is that I need to pass the param from an outside source, say, the xml page that uses this stylesheet ok? I don't know if I'm being clear, but that's my problem. thanks! - Original Message - From: Alexandre Victoor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 25, 2002 11:32 AM Subject: Re: XSL question Hi, you need to declare your parameter at the beginiing of the stylesheet : xsl:param name=yourparam/ xsl:template match=/ Then in the body of your stylesheet, $yourparam gives you the value of the parameter. Good luck Alex - 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: XSL question
Title: RE: XSL question Dear Richard, I understand what you say, but here the problem is if I can get a parameter from an outside source, right? - Original Message - From: Richard Korthuis To: [EMAIL PROTECTED] Sent: Monday, March 25, 2002 11:32 AM Subject: Re: XSL question A while ago I made an XML (Cocoon 1.8)which requested a parameter passed on from a form on a webpage. Maybe you can try something similar for your XSL? xsp:page language="java"xmlns:sql="http://www.apache.org/1999/SQL"xmlns:xsp="http://www.apache.org/1999/XSP/Core"xmlns:request="http://www.apache.org/1999/XSP/Request" datessql:execute-querysql:querydelete from rooster where uniek='request:get-parameter name="uniek"/'/sql:query/sql:execute-query/dates /xsp:page Regards Richard Korthuis - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 3:13 PM Subject: RE: XSL question Ah, good point. I have no experience with pre 2.x Cocoon, so I don't know what would work. I'm sure others around here can answer that though. -T -Original Message-From: Martin Mauri [mailto:[EMAIL PROTECTED]]Sent: Monday, March 25, 2002 9:07 AMTo: [EMAIL PROTECTED]Subject: Re: XSL question Hi Thomas, That's a good answer, unfortunately I forgot to point that I'm using Cocoon 1.8.2. Is there a solution for it? thanks! - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 10:53 AM Subject: RE: XSL question Yes. There is a tutorial on this at cocooncenter.org: http://www.cocooncenter.de/cc/documents/resources/request-params/index.html -Tom -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 8:56 AM To: [EMAIL PROTECTED] Subject: XSL question Hi, this is a kind of offtopic question I think but anyway... Is there a possibility to pass a parameter to a stylesheet? I'd like to do the following: Given a stylesheet, I'd like to include another but depending on a parameter passed by some external source, say an xml page. thanks in advance. Martin - 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: XSL question
-Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 5:36 PM To: [EMAIL PROTECTED] Subject: Re: XSL question Dear Alexandre, Yes, I already know how to use params, but the point here is that I need to pass the param from an outside source, say, the xml page that uses this stylesheet ok? I don't know if I'm being clear, but that's my problem. If you need a param that comes from the page you are processing then there's no need for a param, just use xsl:variable select=/path/to/data-you-need/ and you'll get what you want. If you need a param from some other source (not sitemap) then you can use an Action to create that param for you in sitemap then you can use it as usual. Regards, Konstantin Piroumian thanks! - Original Message - From: Alexandre Victoor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 25, 2002 11:32 AM Subject: Re: XSL question Hi, you need to declare your parameter at the beginiing of the stylesheet : xsl:param name=yourparam/ xsl:template match=/ Then in the body of your stylesheet, $yourparam gives you the value of the parameter. Good luck Alex - 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: XSL question
Dear Konstantin, That's fine, but what I need to do is to choose dinamically between two stylesheets to include in the current one, so it's not possible to use select statement in that stage of the page. I mean: I want to include xsl:include href=params1.xsl/ or xsl:include href=params2.xsl/ depending on a external variable. thanks! If you need a param that comes from the page you are processing then there's no need for a param, just use xsl:variable select=/path/to/data-you-need/ and you'll get what you want. If you need a param from some other source (not sitemap) then you can use an Action to create that param for you in sitemap then you can use it as usual. Regards, Konstantin Piroumian thanks! - Original Message - From: Alexandre Victoor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 25, 2002 11:32 AM Subject: Re: XSL question Hi, you need to declare your parameter at the beginiing of the stylesheet : xsl:param name=yourparam/ xsl:template match=/ Then in the body of your stylesheet, $yourparam gives you the value of the parameter. Good luck Alex - 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] - 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: XSL question
Title: RE: XSL question Hello, What is this outside source? Are you calling the xml with a param (http:///index.xml?param=something) or are you passing this parameter in some other way? Richard - Original Message - From: Martin Mauri To: [EMAIL PROTECTED] ; Richard Korthuis Sent: Monday, March 25, 2002 3:40 PM Subject: Re: XSL question Dear Richard, I understand what you say, but here the problem is if I can get a parameter from an outside source, right? - Original Message - From: Richard Korthuis To: [EMAIL PROTECTED] Sent: Monday, March 25, 2002 11:32 AM Subject: Re: XSL question A while ago I made an XML (Cocoon 1.8)which requested a parameter passed on from a form on a webpage. Maybe you can try something similar for your XSL? xsp:page language="java"xmlns:sql="http://www.apache.org/1999/SQL"xmlns:xsp="http://www.apache.org/1999/XSP/Core"xmlns:request="http://www.apache.org/1999/XSP/Request" datessql:execute-querysql:querydelete from rooster where uniek='request:get-parameter name="uniek"/'/sql:query/sql:execute-query/dates /xsp:page Regards Richard Korthuis - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 3:13 PM Subject: RE: XSL question Ah, good point. I have no experience with pre 2.x Cocoon, so I don't know what would work. I'm sure others around here can answer that though. -T -Original Message-From: Martin Mauri [mailto:[EMAIL PROTECTED]]Sent: Monday, March 25, 2002 9:07 AMTo: [EMAIL PROTECTED]Subject: Re: XSL question Hi Thomas, That's a good answer, unfortunately I forgot to point that I'm using Cocoon 1.8.2. Is there a solution for it? thanks! - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 10:53 AM Subject: RE: XSL question Yes. There is a tutorial on this at cocooncenter.org: http://www.cocooncenter.de/cc/documents/resources/request-params/index.html -Tom -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 8:56 AM To: [EMAIL PROTECTED] Subject: XSL question Hi, this is a kind of offtopic question I think but anyway... Is there a possibility to pass a parameter to a stylesheet? I'd like to do the following: Given a stylesheet, I'd like to include another but depending on a parameter passed by some external source, say an xml page. thanks in advance. Martin - 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: XSL question
Title: RE: XSL question Ok, forget it anyway. Here goes another. Does anyone remember how to define entities inside an xml file without the need of declaring the use of a DTD? thanks! - Original Message - From: Richard Korthuis To: [EMAIL PROTECTED] Sent: Monday, March 25, 2002 12:42 PM Subject: Re: XSL question Hello, What is this outside source? Are you calling the xml with a param (http:///index.xml?param=something) or are you passing this parameter in some other way? Richard - Original Message - From: Martin Mauri To: [EMAIL PROTECTED] ; Richard Korthuis Sent: Monday, March 25, 2002 3:40 PM Subject: Re: XSL question Dear Richard, I understand what you say, but here the problem is if I can get a parameter from an outside source, right? - Original Message - From: Richard Korthuis To: [EMAIL PROTECTED] Sent: Monday, March 25, 2002 11:32 AM Subject: Re: XSL question A while ago I made an XML (Cocoon 1.8)which requested a parameter passed on from a form on a webpage. Maybe you can try something similar for your XSL? xsp:page language="java"xmlns:sql="http://www.apache.org/1999/SQL"xmlns:xsp="http://www.apache.org/1999/XSP/Core"xmlns:request="http://www.apache.org/1999/XSP/Request" datessql:execute-querysql:querydelete from rooster where uniek='request:get-parameter name="uniek"/'/sql:query/sql:execute-query/dates /xsp:page Regards Richard Korthuis - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 3:13 PM Subject: RE: XSL question Ah, good point. I have no experience with pre 2.x Cocoon, so I don't know what would work. I'm sure others around here can answer that though. -T -Original Message-From: Martin Mauri [mailto:[EMAIL PROTECTED]]Sent: Monday, March 25, 2002 9:07 AMTo: [EMAIL PROTECTED]Subject: Re: XSL question Hi Thomas, That's a good answer, unfortunately I forgot to point that I'm using Cocoon 1.8.2. Is there a solution for it? thanks! - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 10:53 AM Subject: RE: XSL question Yes. There is a tutorial on this at cocooncenter.org: http://www.cocooncenter.de/cc/documents/resources/request-params/index.html -Tom -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 8:56 AM To: [EMAIL PROTECTED] Subject: XSL questionHi, this is a kind of offtopic question I think but anyway... Is there a possibility to pass a parameter to a stylesheet? I'd like to do the following: Given a stylesheet, I'd like to include another but depending on a parameter passed by some external source, say an xml page. thanks in advance. Martin - 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: XSL question
Try this: ?xml version=1.0 encoding=UTF-8? !DOCTYPE root [ !ENTITY nbsp #160; ] root ... /root Stefan -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 4:51 PM To: [EMAIL PROTECTED]; Richard Korthuis Subject: Re: XSL question Ok, forget it anyway. Here goes another. Does anyone remember how to define entities inside an xml file without the need of declaring the use of a DTD? thanks! - Original Message - From: Richard Korthuis To: [EMAIL PROTECTED] Sent: Monday, March 25, 2002 12:42 PM Subject: Re: XSL question Hello, What is this outside source? Are you calling the xml with a param (http:///index.xml?param=something) or are you passing this parameter in some other way? Richard - Original Message - From: Martin Mauri To: [EMAIL PROTECTED] ; Richard Korthuis Sent: Monday, March 25, 2002 3:40 PM Subject: Re: XSL question Dear Richard, I understand what you say, but here the problem is if I can get a parameter from an outside source, right? - Original Message - From: Richard Korthuis To: [EMAIL PROTECTED] Sent: Monday, March 25, 2002 11:32 AM Subject: Re: XSL question A while ago I made an XML (Cocoon 1.8) which requested a parameter passed on from a form on a webpage. Maybe you can try something similar for your XSL? xsp:page language=java xmlns:sql=http://www.apache.org/1999/SQL; xmlns:xsp=http://www.apache.org/1999/XSP/Core; xmlns:request=http://www.apache.org/1999/XSP/Request; dates sql:execute-query sql:querydelete from rooster where uniek='request:get-parameter name=uniek/' /sql:query /sql:execute-query /dates /xsp:page Regards Richard Korthuis - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 3:13 PM Subject: RE: XSL question Ah, good point. I have no experience with pre 2.x Cocoon, so I don't know what would work. I'm sure others around here can answer that though. -T -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 9:07 AM To: [EMAIL PROTECTED] Subject: Re: XSL question Hi Thomas, That's a good answer, unfortunately I forgot to point that I'm using Cocoon 1.8.2. Is there a solution for it? thanks! - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 10:53 AM Subject: RE: XSL question Yes. There is a tutorial on this at cocooncenter.org: http://www.cocooncenter.de/cc/documents/resources/request-para ms/index.html -Tom -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 8:56 AM To: [EMAIL PROTECTED] Subject: XSL question Hi, this is a kind of offtopic question I think but anyway... Is there a possibility to pass a parameter to a stylesheet? I'd like to do the following: Given a stylesheet, I'd like to include another but depending on a parameter passed by some external source, say an xml page. thanks in advance. Martin - 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: XSL question
it worked good, thanks! - Original Message - From: Stefan Seifert [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 25, 2002 1:11 PM Subject: RE: XSL question Try this: ?xml version=1.0 encoding=UTF-8? !DOCTYPE root [ !ENTITY nbsp #160; ] root ... /root Stefan -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 4:51 PM To: [EMAIL PROTECTED]; Richard Korthuis Subject: Re: XSL question Ok, forget it anyway. Here goes another. Does anyone remember how to define entities inside an xml file without the need of declaring the use of a DTD? thanks! - Original Message - From: Richard Korthuis To: [EMAIL PROTECTED] Sent: Monday, March 25, 2002 12:42 PM Subject: Re: XSL question Hello, What is this outside source? Are you calling the xml with a param (http:///index.xml?param=something) or are you passing this parameter in some other way? Richard - Original Message - From: Martin Mauri To: [EMAIL PROTECTED] ; Richard Korthuis Sent: Monday, March 25, 2002 3:40 PM Subject: Re: XSL question Dear Richard, I understand what you say, but here the problem is if I can get a parameter from an outside source, right? - Original Message - From: Richard Korthuis To: [EMAIL PROTECTED] Sent: Monday, March 25, 2002 11:32 AM Subject: Re: XSL question A while ago I made an XML (Cocoon 1.8) which requested a parameter passed on from a form on a webpage. Maybe you can try something similar for your XSL? xsp:page language=java xmlns:sql=http://www.apache.org/1999/SQL; xmlns:xsp=http://www.apache.org/1999/XSP/Core; xmlns:request=http://www.apache.org/1999/XSP/Request; dates sql:execute-query sql:querydelete from rooster where uniek='request:get-parameter name=uniek/' /sql:query /sql:execute-query /dates /xsp:page Regards Richard Korthuis - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 3:13 PM Subject: RE: XSL question Ah, good point. I have no experience with pre 2.x Cocoon, so I don't know what would work. I'm sure others around here can answer that though. -T -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 9:07 AM To: [EMAIL PROTECTED] Subject: Re: XSL question Hi Thomas, That's a good answer, unfortunately I forgot to point that I'm using Cocoon 1.8.2. Is there a solution for it? thanks! - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 10:53 AM Subject: RE: XSL question Yes. There is a tutorial on this at cocooncenter.org: http://www.cocooncenter.de/cc/documents/resources/request-para ms/index.html -Tom -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 8:56 AM To: [EMAIL PROTECTED] Subject: XSL question Hi, this is a kind of offtopic question I think but anyway... Is there a possibility to pass a parameter to a stylesheet? I'd like to do the following: Given a stylesheet, I'd like to include another but depending on a parameter passed by some external source, say an xml page. thanks in advance. Martin - 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: Re: XSL question
Hi Mauri, I couldn't forget ;). Neither could I :). You can also include both stylesheets and differentiate the templates with the mode attribute of xsl:template ... /. Then you choose the stylesheet depending on the value of a parameter (xsl:param ... /), and call the templates with xsl:apply-templates mode=desired-mode/. Another way to perform what you want is to include the first stylesheet with xsl:include ... / and import the second one with xsl:import ... /. Then you call either xsl:apply-templates ... / or xsl:apply-imports ... / depending on the value of your parameter. Have a look at the following tutorial : http://www.w3schools.com/xsl/xsl_w3celementref.asp, it's not very detailed but quite useful. Regards, Matthieu Perhaps you could not *include* the stylesheet but do a second transformation after your first one. Depending on your parameter you could insert a new processing instruction to do the transformation you'd like. It could look like Kai Martin Mauri An: [EMAIL PROTECTED], Richard Korthuis mmauri@profe[EMAIL PROTECTED] si.com.ar Kopie: Thema: Re: XSL question 25.03.02 17:21 Bitte antworten an cocoon-users Ok, forget it anyway. Here goes another. Does anyone remember how to define entities inside an xml file without the need of declaring the use of a DTD? thanks! - Original Message - From: Richard Korthuis To: [EMAIL PROTECTED] Sent: Monday, March 25, 2002 12:42 PM Subject: Re: XSL question Hello, What is this outside source? Are you calling the xml with a param ( http:///index.xml?param=something) or are you passing this parameter in some other way? Richard - Original Message - From: Martin Mauri To: [EMAIL PROTECTED] ; Richard Korthuis Sent: Monday, March 25, 2002 3:40 PM Subject: Re: XSL question Dear Richard, I understand what you say, but here the problem is if I can get a parameter from an outside source, right? - Original Message - From: Richard Korthuis To: [EMAIL PROTECTED] Sent: Monday, March 25, 2002 11:32 AM Subject: Re: XSL question A while ago I made an XML (Cocoon 1.8) which requested a parameter passed on from a form on a webpage. Maybe you can try something similar for your XSL? xsp:page language=java xmlns:sql=http://www.apache.org/1999/SQL; xmlns:xsp=http://www.apache.org/1999/XSP/Core; xmlns:request=http://www.apache.org/1999/XSP/Request; dates sql:execute-query sql:querydelete from rooster where uniek='request:get-parameter name =uniek/' /sql:query /sql:execute-query /dates /xsp:page Regards Richard Korthuis - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 3:13 PM Subject: RE: XSL question Ah, good point. I have no experience with pre 2.x Cocoon, so I don't know what would work. I'm sure others around here can answer that though. -T -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 9:07 AM To: [EMAIL PROTECTED] Subject: Re: XSL question Hi Thomas, That's a good answer, unfortunately I forgot to point that I'm using Cocoon 1.8.2. Is there a solution for it? thanks! - Original Message - From: von Schwerdtner, Thomas (GXS, FPI) To: '[EMAIL PROTECTED]' Sent: Monday, March 25, 2002 10:53 AM Subject: RE: XSL question Yes. There is a tutorial on this at cocooncenter.org: http://www.cocooncenter.de/cc/documents/resources/request-params/i ndex.html -Tom -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 8:56 AM To: [EMAIL PROTECTED] Subject: XSL question Hi, this is a kind of offtopic question I think but anyway... Is there a possibility to pass a parameter to a stylesheet? I'd like to do the following: Given a stylesheet, I'd like to include another but depending on a parameter passed by some external source, say an xml page. thanks in advance. Martin - 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: XSL question
Just another thought If you have the handle to the Transformer object, you could parse or obtain the parameters and then set use the setParameter() method on the Transformer object to set the parameters for the XSL... To do the above, you may have to write your own generator (refer Stream Generator for reference) Hope this helps Regds, Chiths -Original Message- From: Martin Mauri [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 7:12 AM To: [EMAIL PROTECTED] Subject: Re: XSL question Dear Konstantin, That's fine, but what I need to do is to choose dinamically between two stylesheets to include in the current one, so it's not possible to use select statement in that stage of the page. I mean: I want to include xsl:include href=params1.xsl/ or xsl:include href=params2.xsl/ depending on a external variable. thanks! If you need a param that comes from the page you are processing then there's no need for a param, just use xsl:variable select=/path/to/data-you-need/ and you'll get what you want. If you need a param from some other source (not sitemap) then you can use an Action to create that param for you in sitemap then you can use it as usual. Regards, Konstantin Piroumian thanks! - Original Message - From: Alexandre Victoor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 25, 2002 11:32 AM Subject: Re: XSL question Hi, you need to declare your parameter at the beginiing of the stylesheet : xsl:param name=yourparam/ xsl:template match=/ Then in the body of your stylesheet, $yourparam gives you the value of the parameter. Good luck Alex - 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] - 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: Simple XSL question
Simone, Just for the record, I went on using this template. xsl:template match=@* | node() xsl:copy xsl:apply-templates select=@* | node()/ /xsl:copy /xsl:template I still wonder if it is not a bad design to generate a base xml at the begining of the pipeline, aggregate other generated xml data and then go into a number of transformations for each specific section of the base xml, transforming them with the other generated data, and copying all the unused data, in each transformation, for the rest of the pipeline, basically in terms of performance. By now, that's what I'm doing. Thanks, -Mensaje original- De: Simone Gianni [mailto:[EMAIL PROTECTED]] Enviado el: lunes, 28 de enero de 2002 12:50 Para: [EMAIL PROTECTED] Asunto: Re: Simple XSL question At 12.37 28/01/2002 -0300, you wrote: Hello, How can I make a XSLT transformation of just a couple of elements, leaving the rest untouched, without having to select everything and passing it through? You can create a catch all template with lower priority, for example : xsl:template match=something dosomething/do /xsl:template xsl:template match=*|node() priority=-10 xsl:copy-of select=./ /xsl:template This means that if something is found, it will be processed by the first template, if else is found it will be processed by the second template, which does a copy. The lower priority is an optional, since the XSLT processor should use the first template since it's more specific, but I've had some strange results, and forcing it is a good idea. I'm not sure about the xsl:copy-of .. ... it could cause some duplications, you could try a xsl:copy/ and see which one works better ... Ciao Simone - 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: Simple XSL question
xsl:import and xsl:include are your friends when you start getting concerned about performance issues and want to do everything in one pass! Of course though, if you generate one form of content, and then transform it to another form of content (say, xml-docbook-html) you are SOL. :( Simone, Just for the record, I went on using this template. xsl:template match=@* | node() xsl:copy xsl:apply-templates select=@* | node()/ /xsl:copy /xsl:template I still wonder if it is not a bad design to generate a base xml at the begining of the pipeline, aggregate other generated xml data and then go into a number of transformations for each specific section of the base xml, transforming them with the other generated data, and copying all the unused data, in each transformation, for the rest of the pipeline, basically in terms of performance. By now, that's what I'm doing. Thanks, -Mensaje original- De: Simone Gianni [mailto:[EMAIL PROTECTED]] Enviado el: lunes, 28 de enero de 2002 12:50 Para: [EMAIL PROTECTED] Asunto: Re: Simple XSL question At 12.37 28/01/2002 -0300, you wrote: Hello, How can I make a XSLT transformation of just a couple of elements, leaving the rest untouched, without having to select everything and passing it through? You can create a catch all template with lower priority, for example : xsl:template match=something dosomething/do /xsl:template xsl:template match=*|node() priority=-10 xsl:copy-of select=./ /xsl:template This means that if something is found, it will be processed by the first template, if else is found it will be processed by the second template, which does a copy. The lower priority is an optional, since the XSLT processor should use the first template since it's more specific, but I've had some strange results, and forcing it is a good idea. I'm not sure about the xsl:copy-of .. ... it could cause some duplications, you could try a xsl:copy/ and see which one works better ... Ciao - 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]