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/24 11:00:12 UTC

[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>


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>