You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Cocoon User <co...@eng.gr> on 2002/12/23 19:10:20 UTC
[solved!?]Re: xsl through pipeline [NOT supported???]
atleast i have a simple example that works
i call an xsl through pipeline but using only generation and serialization
(i just read the .xsl using a pipeline) and use this xsl for
transformation into another pipeline using cocoon:/ protocol
i'll put this example in url tomorow
now i'm a litle confused how to create a xsl from a
xml---xsl-->transformation
i have found very usefull your post anna...thnx
stavros
On Mon, 23 Dec 2002, Anna Afonchenko wrote:
> If you say that when you call the generateXSL pipeline and it gives you the
> right xsl, it should provide the same xsl when called using the cocoon:/
> protocol.
> Can you write your exact pipelines and give the xsl files?
> Please omit all unnecessary stuff.
>
> Regards,
> Anna
>
> ----- Original Message -----
> From: "Cocoon User" <co...@eng.gr>
> To: <co...@xml.apache.org>
> Sent: Monday, December 23, 2002 2:03 PM
> Subject: Re: xsl through pipeline [NOT supported???]
>
>
>
> i have try to ask http://..../cocoon/generateXSL/
> with a browser and save the output (XSL) im my disk
> then i use this XSL to transform a xml file (into xmlspy)
> and everything are OK.
>
>
> another one test
>
> using
> <map:transform src="savedXSL.xsl"/>
>
> my transformation work fine (savedXSL.xsl is the file i have get above)
>
> replace this entry with
>
> <map:transform src="cocoon:/generateXSL"/>
> my pipeline give me an output other than i expect....(i thing that
> <map:transform src="cocoon:/generateXSL"/> return an empty .xsl file)
>
>
> maybe we need the cocoons guru help :-)
>
> stavros
>
> (what a problem 2 days before christmas !!!!)
>
>
>
> On Mon, 23 Dec 2002, Anna Afonchenko wrote:
>
> > Stavros
> > What happens if you try to generate your xsl outside cocoon (using batch
> > file) and then just use it as a transformer in your pipeline (i.e. without
> > calling the cocoon:/ protocol)?
> > If you get the right answer there, then I think the problem is with
> cocoon,
> > but it is strange, because I don't see any dramatic difference between
> your
> > sitemap and mine. But as I said, I'm new to cocoon, so I may be wrong.
> > Maybe somebody else will be able to give better answer.
> >
> > Good luck
> > Anna
> >
> > ----- Original Message -----
> > From: "Cocoon User" <co...@eng.gr>
> > To: <co...@xml.apache.org>
> > Sent: Monday, December 23, 2002 12:45 PM
> > Subject: Re: xsl through pipeline [NOT supported???]
> >
> >
> >
> >
> > in my case when i call http://...cocoon/generateXSL
> > where generateXSL is a pipeline that produce the xsl i want i get in my
> > browser the right (produced) xsl file.
> >
> >
> > but this file make to sense when i call it using cocoon:/ protocol in an
> > other pipeline to transform a xml file
> >
> > maybe this approach dosnt supported from cocoon (yet..)
> >
> > if this is not my fault (if i dont miss somenthing then is a good idea to
> > make a post to -dev- list)
> >
> >
> > i dont understand what can be the content of your test.html
> > is it a xml file or an empty file?
> >
> > in my case i want instead of your test.html to have xslInstructions.xml
> >
> >
> >
> > On Mon, 23 Dec 2002, Anna Afonchenko wrote:
> >
> > > Hi Stavros.
> > > Here are my pipelines for using xsl generated through Cocoon:
> > > <map:match pattern="try">
> > > <map:generate src="ub/violations.html"/>
> > > <map:transform type="xslt-saxon" src="cocoon://generateXsl"/>
> > > <map:serialize type="xml"/>
> > > </map:match>
> > > <map:match pattern="generateXsl">
> > > <map:generate src="ub/test.html"/>
> > > <map:transform type="xslt-saxon" src="ub/generateXSL.xsl"/>
> > > <map:serialize type="xml"/>
> > > </map:match>
> > >
> > > In pipeline generateXsl I use dummy html for generator, because for some
> > > reason, if I try to write instead:
> > > <map:match pattern="generateXsl">
> > > <map:generate src="ub/generateXSL.xsl"/>
> > > <map:serialize type="xml"/>
> > > </map:match>
> > >
> > > then what I get calling cocoon/try is the stylesheet generateXSL
> (exactly
> > as
> > > if I was just calling cocoon/generateXsl) - I don't understand this, but
> > > maybe someone more experienced than me on this list can explain it to
> us.
> > > But maybe you should also use dummy html/xml in generator?
> > >
> > > BTW, now I posted a message about creating some more complicated
> > stylesheets
> > > through Cocoon, because when I try to create some more complicated xsl,
> I
> > > get an error. But for some simple xsl it works fine for me, so check
> both
> > > your pipelines and your xsl.
> > >
> > > Good luck.
> > > Anna
> > >
> > > ----- Original Message -----
> > > From: "Cocoon User" <co...@eng.gr>
> > > To: <co...@xml.apache.org>
> > > Sent: Monday, December 23, 2002 12:03 PM
> > > Subject: Re: xsl through pipeline [NOT supported???]
> > >
> > >
> > >
> > >
> > > hi anna thnx for your reply
> > > i try this very simple sample before go on .... and i dont get
> > > the result i want. it very strange to be any problem in .xsl becaus its
> > > very simple.
> > >
> > > is it possible to send me a snapshot of your sitemap where your .xsl
> pass
> > > (and generated) through a pipeline?
> > >
> > >
> > > stavros
> > >
> > > i u want to contact me directly use: gounis@osmosis.gr
> > >
> > >
> > > On Mon, 23 Dec 2002, Anna Afonchenko wrote:
> > >
> > > > Cocoon definitely supports using transformer that is itself generated
> by
> > > > some pipeline. At least, it works for me.
> > > > Maybe you have some problems in your xsl?
> > > >
> > > > ----- Original Message -----
> > > > From: "Cocoon User" <co...@eng.gr>
> > > > To: <co...@xml.apache.org>; <ni...@apache.org>
> > > > Sent: Monday, December 23, 2002 1:58 AM
> > > > Subject: xsl through pipeline [NOT supported???]
> > > >
> > > >
> > > > i try to transform a .xml using a .xsl that will be generated using a
> > > > pipeline
> > > >
> > > >
> > > > in my sitemap i have
> > > >
> > > >
> > > > <map:match pattern="myXML">
> > > > <map:generate src="./myxml.xml"/>
> > > > <map:transform src="./myxsl.xsl"/>
> > > > <map:serialize type="xml"/>
> > > > </map:match>
> > > >
> > > >
> > > > <map:match pattern="myXMLagain">
> > > > <map:generate src="myxml.xml"/>
> > > > <map:transform src="cocoon:/getXSL"/>
> > > > <map:serialize type="xml"/>
> > > > </map:match>
> > > >
> > > > <map:match pattern="getXSL">
> > > > <map:generate src="./myxsl.xsl"/>
> > > > <map:serialize type="xml"/>
> > > > </map:match>
> > > >
> > > >
> > > > ------------------
> > > > this is a very simple example
> > > > (there is no transformation in getXSL, if this work i will try to
> > produce
> > > > the .xsl)
> > > >
> > > > when i call http://..../myXML i get the results i wait for
> > > > when i call http://..../getXSL i see in my browser my xsl file (in xml
> > > > format)
> > > >
> > > >
> > > > but .... whet i call
> > > > http://..../myXMLagain i dont get any error msg but i dont get any
> > results
> > > > it seems like cocoon just ignore [<map:transform
> src="cocoon:/getXSL"/>]
> > > > line os get an empty xsl.
> > > >
> > > >
> > > > maybe this is something that cocoon not support or something else ?
> > > >
> > > >
> > > > i try to produce dynamic the xsl file. i want users be able to
> describe
> > > > xsl's files using a simple xml.
> > > >
> > > >
> > > >
> > > > thnx
> > > >
> > > > stavros kounis
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > 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: <co...@xml.apache.org>
> > > > For additional commands, e-mail: <co...@xml.apache.org>
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > 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: <co...@xml.apache.org>
> > > > For additional commands, e-mail: <co...@xml.apache.org>
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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: <co...@xml.apache.org>
> > > For additional commands, e-mail: <co...@xml.apache.org>
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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: <co...@xml.apache.org>
> > > For additional commands, e-mail: <co...@xml.apache.org>
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > 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: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
> >
> >
> > ---------------------------------------------------------------------
> > 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: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
> >
> >
>
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: [demostration] Re: xsl through pipelin [anyone can help?]
Posted by Conal Tuohy <co...@paradise.net.nz>.
Instead of creating elements with <xsl:element name="foo" namespace="bar"/>,
you can also use a namespace alias. The namespace-alias xsl element is used
mostly for this purpose (xsl generating xsl).
Cheers
Con
See http://www.google.com/search?q=namespace%2Dalias
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: [demostration] Re: xsl through pipelin [anyone can help?]
Posted by Luca Morandini <lu...@tin.it>.
Stavros,
I guess you aren't aware of that little "nameapace" attribute :)
Anyway, here are the modified pipelines:
<!-- HTML output by generated XSL-->
<map:match pattern="hello.html">
<map:generate src="./htdocs/hello.xml"/>
<map:transform src="/cocoon:sitebuilder.xsl"/>
<map:serialize type="html"/>
</map:match>
<!-- XSL through pipeline by XSLT -->
<map:match pattern="sitebuilder.xsl">
<map:generate src="./htdocs/hello.xml"/>
<map:transform src="./htdocs/makexsl.xsl"/>
<map:serialize type="xml"/>
</map:match>
...and here's the makexsl.xsl stylesheet doing the trick:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:element name="xsl:stylesheet"
namespace="http://www.w3.org/1999/XSL/Transform">
<xsl:element name="xsl:template"
namespace="http://www.w3.org/1999/XSL/Transform">
<xsl:attribute name="match">page</xsl:attribute>
<xsl:element name="html">
<xsl:element name="head">
<xsl:element name="title">
hello...
</xsl:element>
</xsl:element>
<xsl:element name="body">
<xsl:element name="xsl:call-template"
namespace="http://www.w3.org/1999/XSL/Transform">
<xsl:attribute name="name">para</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
<xsl:element name="xsl:template"
namespace="http://www.w3.org/1999/XSL/Transform">
<xsl:attribute name="name">para</xsl:attribute>
<p>
<xsl:element name="xsl:value-of"
namespace="http://www.w3.org/1999/XSL/Transform">
<xsl:attribute name="select">para</xsl:attribute>
</xsl:element>
</p>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
I think this should fit the bill.
Best regards,
P.S.
I'd rather avoid making XSLs on the fly... unless for didactic purposes.
---------------------------------------------
Luca Morandini
GIS Consultant
lmorandini@ieee.org
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------
> -----Original Message-----
> From: Cocoon User [mailto:cocoon@eng.gr]
> Sent: Tuesday, December 24, 2002 11:51 AM
> To: cocoon-users@xml.apache.org; lmorandini@ieee.org
> Subject: RE: [demostration] Re: xsl through pipelin [anyone can help?]
>
>
>
> in patern getXSL
> now i read a xsl file
>
>
> i want to read(generate) a xml file and trasform it
> to xsl using another xsl
> but i have problem with name spaces (and i dont know if its possible)
>
> how can an xsl file generate elements that belongs to xsl namespace too
> i think about to use for the produced xsl name space prefix other than xsl
> but is this possible and how cocoon will react ?
>
>
>
> (i know that this is more an XML/XSL than cocoon about question sorry
> about this)
>
> thnx for your reply
>
> stavros
>
>
> On Tue, 24 Dec 2002, Luca Morandini wrote:
>
> > Stavros,
> >
> > ok, I've downloaded the demo and installed it... could you tell me where is, exactly, the problem ?
> >
> > Best regards,
> >
> > P.S.
> > I'm about to go out for a trip: if you want some help from me hurry up... in a couple of hours I will be out of your reach !
> >
> > ---------------------------------------------
> > Luca Morandini
> > GIS Consultant
> > lmorandini@ieee.org
> > http://utenti.tripod.it/lmorandini/index.html
> > ---------------------------------------------
> >
> >
> > > -----Original Message-----
> > > From: Cocoon User [mailto:cocoon@eng.gr]
> > > Sent: Tuesday, December 24, 2002 11:00 AM
> > > To: cocoon-users@xml.apache.org
> > > Subject: [demostration] Re: xsl through pipelin [anyone can help?]
> > >
> > >
> > >
> > > i have a working demo that pass a xsl file through pipeline and call it
> > > using
> > > cocoon:/ protocol to transform other .xml's
> > >
> > > but i have problems to create this .xsl using xml/xsl (confused with
> > > namespaces)
> > >
> > > demo files are:
> > > http://www.osmosis.gr/temp/osDynXSL.zip
> > >
> > >
> > > stavros
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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: <co...@xml.apache.org>
> > > For additional commands, e-mail: <co...@xml.apache.org>
> > >
> >
> > ---------------------------------------------------------------------
> > 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: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
> >
> >
>
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: [demostration] Re: xsl through pipelin [anyone can help?]
Posted by Cocoon User <co...@eng.gr>.
in patern getXSL
now i read a xsl file
i want to read(generate) a xml file and trasform it
to xsl using another xsl
but i have problem with name spaces (and i dont know if its possible)
how can an xsl file generate elements that belongs to xsl namespace too
i think about to use for the produced xsl name space prefix other than xsl
but is this possible and how cocoon will react ?
(i know that this is more an XML/XSL than cocoon about question sorry
about this)
thnx for your reply
stavros
On Tue, 24 Dec 2002, Luca Morandini wrote:
> Stavros,
>
> ok, I've downloaded the demo and installed it... could you tell me where is, exactly, the problem ?
>
> Best regards,
>
> P.S.
> I'm about to go out for a trip: if you want some help from me hurry up... in a couple of hours I will be out of your reach !
>
> ---------------------------------------------
> Luca Morandini
> GIS Consultant
> lmorandini@ieee.org
> http://utenti.tripod.it/lmorandini/index.html
> ---------------------------------------------
>
>
> > -----Original Message-----
> > From: Cocoon User [mailto:cocoon@eng.gr]
> > Sent: Tuesday, December 24, 2002 11:00 AM
> > To: cocoon-users@xml.apache.org
> > Subject: [demostration] Re: xsl through pipelin [anyone can help?]
> >
> >
> >
> > i have a working demo that pass a xsl file through pipeline and call it
> > using
> > cocoon:/ protocol to transform other .xml's
> >
> > but i have problems to create this .xsl using xml/xsl (confused with
> > namespaces)
> >
> > demo files are:
> > http://www.osmosis.gr/temp/osDynXSL.zip
> >
> >
> > stavros
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
> >
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: [demostration] Re: xsl through pipelin [anyone can help?]
Posted by Luca Morandini <lu...@tin.it>.
Stavros,
ok, I've downloaded the demo and installed it... could you tell me where is, exactly, the problem ?
Best regards,
P.S.
I'm about to go out for a trip: if you want some help from me hurry up... in a couple of hours I will be out of your reach !
---------------------------------------------
Luca Morandini
GIS Consultant
lmorandini@ieee.org
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------
> -----Original Message-----
> From: Cocoon User [mailto:cocoon@eng.gr]
> Sent: Tuesday, December 24, 2002 11:00 AM
> To: cocoon-users@xml.apache.org
> Subject: [demostration] Re: xsl through pipelin [anyone can help?]
>
>
>
> i have a working demo that pass a xsl file through pipeline and call it
> using
> cocoon:/ protocol to transform other .xml's
>
> but i have problems to create this .xsl using xml/xsl (confused with
> namespaces)
>
> demo files are:
> http://www.osmosis.gr/temp/osDynXSL.zip
>
>
> stavros
>
>
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
[demostration] Re: xsl through pipelin [anyone can help?]
Posted by Cocoon User <co...@eng.gr>.
i have a working demo that pass a xsl file through pipeline and call it
using
cocoon:/ protocol to transform other .xml's
but i have problems to create this .xsl using xml/xsl (confused with
namespaces)
demo files are:
http://www.osmosis.gr/temp/osDynXSL.zip
stavros
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>