You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Erik Norvelle <er...@norvelle.net> on 2000/03/11 11:31:05 UTC

Embedding XML output of XSP into another XML page?

Folks:

I have recently gotten Cocoon installed, and it works great.  However, I 
appear to have run into a roadblock.

Here is what I need to do:

1) A Cocoon SQL page returns a rowset, which I format with the 
<?cocoon-format ?> PI and an XSLT stylesheet, to return some "nice" XML 
(as opposed to the rather ugly raw resultset coming directly from the 
<query> tag.
2) I use a DTD ELEMENT declaration to insert the resulting document 
(referenced via http, so that Cocoon does the appropriate 
pre-processing) into my master XML document.  This document then gets 
processed by a second XSLT transform, with the end result needing to be 
in HTML.

The problem?  The page that results from step 1 *always* has a the 
following doctype inserted:  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 
4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">.  Needless to 
say, Cocoon chokes on this, because it wants only entities or CDATA 
being inserted as a result of the element's expansion.

I have tried to use the <xsl:output method="xml"/> tag in the stylesheet 
that transforms step #1, but to no avail.  Nothing I have done can 
suppress the DOCTYPE declaration from being inserted.

I can get around this by eliminating the XSLT transform in step #1, but 
this causes problems later, by unnecesarily complicating the transform 
that I have to do in step #2.  I want the XML that gets inserted to be 
as clean as I can make it, so that my XSLT sheets don't get hideously 
complex.

Am I missing something dreadfully obvious?  Or am I barking up the wrong 
tree altogether?

-Erik Norvelle
erik@norvelle.net


Re: Embedding XML output of XSP into another XML page?

Posted by Stefano Mazzocchi <st...@apache.org>.
Erik Norvelle wrote:
> 
> To Stefano &/or other Cocoon project leads:
> 
> If I wanted to contribute something to the documentation, who would I get in
> touch with.  I wouldn't mind writing bits and pieces regarding the
> problems/solutions I have come up with...

Send the pieces to me.

Or, in case, you want to contribute on a more regular basis, we'll be
more than happy to give you commit access on the CVS.

Just let us know the degree of your involvement and we'll find out the
best way to cooperate.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------



Re: Embedding XML output of XSP into another XML page?

Posted by Stefano Mazzocchi <st...@apache.org>.
Erik Norvelle wrote:
> 
> Preferred format, mostly, and also where I should send my contributions...

The format is XML with the Documentation DTD.

Look in the "xdocs" directory of the distribution and learn by
examples.. it's a very simple DTD.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------



Re: Cocoon producers and Tomcat

Posted by Stefano Mazzocchi <st...@apache.org>.
Darryl Stoflet wrote:
> 
> Stephano,

Stefano, please
 
>         I sent in a report to bugzilla that I thought addressed this and
> offered a remedy. If cocoon is in the classpath (as it is in the
> howto installation guides) it will be loaded by the system class
> loader, which knows nothing about the web-inf/classes or web-inf/lib
> directories. Thus when cocoon trys to load classes or any resource not
> in the system classpath it will fail, as the example below does
> when a producer is placed in the web-inf/classes directory.
> The 2 solutions are to either place all resources and classes in the
> system classpath including cocoon, or put cocoon in a web-inf directory
> and then it will be able to see the resources and classes in that
> contexts web-inf/classes and web-inf/lib directory as well as the system
> classpath. If you opt to enable placing cocoon in web-inf/classes
> you must also refrain from the usage of ClassLoader.getSystemResource()
> as it will use the system classloader. Instead use
> getClass().getClassLoader().getResource.

Already patched this but it doesn't work. I suspect a bug in the
JServ/Tomcat classloader implementation even if this seems very strange.

I'll play around more with it today.
 
> /Darryl Stoflet
> 
> Stefano Mazzocchi wrote:
> >
> > Kevin Jones wrote:
> > >
> > > if I'm using Cocoon from within Tomcat (the latest 3.1 build). If I add a
> > > producer to the cocoon.properties file I get the following
> > >
> > > java.lang.RuntimeException: Error creating
> > > kevinj.develop.util.WeatherProducer: class is not found
> > >
> > > I've put the class (package and all) under WEB-INF/classes, so the question
> > > is, where does Cocoon expect to find the producer class (or am I missing
> > > something else?) ?
> >
> > I am currently trying to address the classloading/resourceloading
> > problems in Cocoon 1.7.1-dev to make it possible to use it in Tomcat or
> > under a specific jserv servlet zone.
> >
> > The problem is that classloader behavior is a real pain in the ass,
> > expecially between 1.1 and 1.2 java versions.
> >
> > But today I'll install tomcat 3.1b and see what happens.
> >
> > --
> > Stefano Mazzocchi      One must still have chaos in oneself to be
> >                           able to give birth to a dancing star.
> > <st...@apache.org>                             Friedrich Nietzsche
> > --------------------------------------------------------------------
> >  Come to the first official Apache Software Foundation Conference!
> > ------------------------- http://ApacheCon.Com ---------------------
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 
> --
> Darryl Stoflet
> http://dstoflet.calweb.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



RE: Cocoon producers and Tomcat

Posted by Kevin Jones <ke...@develop.com>.
I was one of the people who posted the fix for the Tomcat web-inf/lib bug
about two weeks ago so I know all about that :-) The version of Tomcat I'm
using is the overnight March 16th build (which that fix should be in), and I
can't get Cocoon loaded from the lib directory!

I'll check my versions and try it again!

Kevin Jones
DevelopMentor
www.develop.com

> -----Original Message-----
> From: Darryl Stoflet [mailto:dstoflet@calweb.com]
> Sent: 17 March 2000 13:16
> To: cocoon-users@xml.apache.org
> Subject: Re: Cocoon producers and Tomcat
>
>
> Kevin,
>
> 	Tomcat -had- a bug where it wouldn't load jars from the
> web-inf/lib directory so unless you want to rebuild from the latest source
> you should not place jars there. Initially, I had placed an unjarred
> cocoon in my contexts web-inf/classes but this will fail because
> cocoon uses ClassLoader.getSystemResource() which will try to load
> resources from the system classpath (which web-inf/classes is not
> a part of). So the only solution to your problem at this time is
> to place cocoon and your producer in the classpath. However be aware
> that since your producer will be loaded by the system classloader
> you should not attempt to load resources using any of the classloader
> getResourceXXX variants unless you place that resource on the classpath.
> Instead, to refer to resources (relative to your context) you will
> need to build a path as the ProducerFromFile/Utils does e.g.,
> URL resource = ((ServletContext)
> context).getResource(request.getServletPath());
>
> /Darryl Stoflet
>
> Kevin Jones wrote:
> >
> > OK I understand that, but if I put cocoon in the WEB-INF/lib
> directory it
> > doesn't get loaded, so do I expand the jar into
> WEB-INF/classes, or can I
> > put Cocoon into the tomcat\lib directory (I'm guessing that the
> answer to
> > the second part is no),
> >
> > Kevin Jones
> > DevelopMentor
> > www.develop.com
> >
> > > -----Original Message-----
> > > From: Darryl Stoflet [mailto:dstoflet@calweb.com]
> > > Sent: 17 March 2000 00:18
> > > To: cocoon-users@xml.apache.org
> > > Subject: Re: Cocoon producers and Tomcat
> > >
> > >
> > > Stephano,
> > >
> > >       I sent in a report to bugzilla that I thought addressed this and
> > > offered a remedy. If cocoon is in the classpath (as it is in the
> > > howto installation guides) it will be loaded by the system class
> > > loader, which knows nothing about the web-inf/classes or web-inf/lib
> > > directories. Thus when cocoon trys to load classes or any resource not
> > > in the system classpath it will fail, as the example below does
> > > when a producer is placed in the web-inf/classes directory.
> > > The 2 solutions are to either place all resources and classes in the
> > > system classpath including cocoon, or put cocoon in a web-inf
> directory
> > > and then it will be able to see the resources and classes in that
> > > contexts web-inf/classes and web-inf/lib directory as well as
> the system
> > > classpath. If you opt to enable placing cocoon in web-inf/classes
> > > you must also refrain from the usage of
> ClassLoader.getSystemResource()
> > > as it will use the system classloader. Instead use
> > > getClass().getClassLoader().getResource.
> > >
> > > /Darryl Stoflet
> > >
> > >
> > >
> > > Stefano Mazzocchi wrote:
> > > >
> > > > Kevin Jones wrote:
> > > > >
> > > > > if I'm using Cocoon from within Tomcat (the latest 3.1
> > > build). If I add a
> > > > > producer to the cocoon.properties file I get the following
> > > > >
> > > > > java.lang.RuntimeException: Error creating
> > > > > kevinj.develop.util.WeatherProducer: class is not found
> > > > >
> > > > > I've put the class (package and all) under WEB-INF/classes,
> > > so the question
> > > > > is, where does Cocoon expect to find the producer class (or
> > > am I missing
> > > > > something else?) ?
> > > >
> > > > I am currently trying to address the classloading/resourceloading
> > > > problems in Cocoon 1.7.1-dev to make it possible to use it
> in Tomcat or
> > > > under a specific jserv servlet zone.
> > > >
> > > > The problem is that classloader behavior is a real pain in the ass,
> > > > expecially between 1.1 and 1.2 java versions.
> > > >
> > > > But today I'll install tomcat 3.1b and see what happens.
> > > >
> > > > --
> > > > Stefano Mazzocchi      One must still have chaos in oneself to be
> > > >                           able to give birth to a dancing star.
> > > > <st...@apache.org>                             Friedrich Nietzsche
> > > > --------------------------------------------------------------------
> > > >  Come to the first official Apache Software Foundation Conference!
> > > > ------------------------- http://ApacheCon.Com ---------------------
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > > > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> > >
> > > --
> > > Darryl Stoflet
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Cocoon producers and Tomcat

Posted by Darryl Stoflet <ds...@calweb.com>.
Kevin,

	Tomcat -had- a bug where it wouldn't load jars from the 
web-inf/lib directory so unless you want to rebuild from the latest source
you should not place jars there. Initially, I had placed an unjarred
cocoon in my contexts web-inf/classes but this will fail because 
cocoon uses ClassLoader.getSystemResource() which will try to load
resources from the system classpath (which web-inf/classes is not
a part of). So the only solution to your problem at this time is
to place cocoon and your producer in the classpath. However be aware 
that since your producer will be loaded by the system classloader
you should not attempt to load resources using any of the classloader
getResourceXXX variants unless you place that resource on the classpath.
Instead, to refer to resources (relative to your context) you will
need to build a path as the ProducerFromFile/Utils does e.g.,
URL resource = ((ServletContext) context).getResource(request.getServletPath());

/Darryl Stoflet

Kevin Jones wrote:
> 
> OK I understand that, but if I put cocoon in the WEB-INF/lib directory it
> doesn't get loaded, so do I expand the jar into WEB-INF/classes, or can I
> put Cocoon into the tomcat\lib directory (I'm guessing that the answer to
> the second part is no),
> 
> Kevin Jones
> DevelopMentor
> www.develop.com
> 
> > -----Original Message-----
> > From: Darryl Stoflet [mailto:dstoflet@calweb.com]
> > Sent: 17 March 2000 00:18
> > To: cocoon-users@xml.apache.org
> > Subject: Re: Cocoon producers and Tomcat
> >
> >
> > Stephano,
> >
> >       I sent in a report to bugzilla that I thought addressed this and
> > offered a remedy. If cocoon is in the classpath (as it is in the
> > howto installation guides) it will be loaded by the system class
> > loader, which knows nothing about the web-inf/classes or web-inf/lib
> > directories. Thus when cocoon trys to load classes or any resource not
> > in the system classpath it will fail, as the example below does
> > when a producer is placed in the web-inf/classes directory.
> > The 2 solutions are to either place all resources and classes in the
> > system classpath including cocoon, or put cocoon in a web-inf directory
> > and then it will be able to see the resources and classes in that
> > contexts web-inf/classes and web-inf/lib directory as well as the system
> > classpath. If you opt to enable placing cocoon in web-inf/classes
> > you must also refrain from the usage of ClassLoader.getSystemResource()
> > as it will use the system classloader. Instead use
> > getClass().getClassLoader().getResource.
> >
> > /Darryl Stoflet
> >
> >
> >
> > Stefano Mazzocchi wrote:
> > >
> > > Kevin Jones wrote:
> > > >
> > > > if I'm using Cocoon from within Tomcat (the latest 3.1
> > build). If I add a
> > > > producer to the cocoon.properties file I get the following
> > > >
> > > > java.lang.RuntimeException: Error creating
> > > > kevinj.develop.util.WeatherProducer: class is not found
> > > >
> > > > I've put the class (package and all) under WEB-INF/classes,
> > so the question
> > > > is, where does Cocoon expect to find the producer class (or
> > am I missing
> > > > something else?) ?
> > >
> > > I am currently trying to address the classloading/resourceloading
> > > problems in Cocoon 1.7.1-dev to make it possible to use it in Tomcat or
> > > under a specific jserv servlet zone.
> > >
> > > The problem is that classloader behavior is a real pain in the ass,
> > > expecially between 1.1 and 1.2 java versions.
> > >
> > > But today I'll install tomcat 3.1b and see what happens.
> > >
> > > --
> > > Stefano Mazzocchi      One must still have chaos in oneself to be
> > >                           able to give birth to a dancing star.
> > > <st...@apache.org>                             Friedrich Nietzsche
> > > --------------------------------------------------------------------
> > >  Come to the first official Apache Software Foundation Conference!
> > > ------------------------- http://ApacheCon.Com ---------------------
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> >
> > --
> > Darryl Stoflet
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

RE: Cocoon producers and Tomcat

Posted by Kevin Jones <ke...@develop.com>.
OK I understand that, but if I put cocoon in the WEB-INF/lib directory it
doesn't get loaded, so do I expand the jar into WEB-INF/classes, or can I
put Cocoon into the tomcat\lib directory (I'm guessing that the answer to
the second part is no),

Kevin Jones
DevelopMentor
www.develop.com

> -----Original Message-----
> From: Darryl Stoflet [mailto:dstoflet@calweb.com]
> Sent: 17 March 2000 00:18
> To: cocoon-users@xml.apache.org
> Subject: Re: Cocoon producers and Tomcat
>
>
> Stephano,
>
> 	I sent in a report to bugzilla that I thought addressed this and
> offered a remedy. If cocoon is in the classpath (as it is in the
> howto installation guides) it will be loaded by the system class
> loader, which knows nothing about the web-inf/classes or web-inf/lib
> directories. Thus when cocoon trys to load classes or any resource not
> in the system classpath it will fail, as the example below does
> when a producer is placed in the web-inf/classes directory.
> The 2 solutions are to either place all resources and classes in the
> system classpath including cocoon, or put cocoon in a web-inf directory
> and then it will be able to see the resources and classes in that
> contexts web-inf/classes and web-inf/lib directory as well as the system
> classpath. If you opt to enable placing cocoon in web-inf/classes
> you must also refrain from the usage of ClassLoader.getSystemResource()
> as it will use the system classloader. Instead use
> getClass().getClassLoader().getResource.
>
> /Darryl Stoflet
>
>
>
> Stefano Mazzocchi wrote:
> >
> > Kevin Jones wrote:
> > >
> > > if I'm using Cocoon from within Tomcat (the latest 3.1
> build). If I add a
> > > producer to the cocoon.properties file I get the following
> > >
> > > java.lang.RuntimeException: Error creating
> > > kevinj.develop.util.WeatherProducer: class is not found
> > >
> > > I've put the class (package and all) under WEB-INF/classes,
> so the question
> > > is, where does Cocoon expect to find the producer class (or
> am I missing
> > > something else?) ?
> >
> > I am currently trying to address the classloading/resourceloading
> > problems in Cocoon 1.7.1-dev to make it possible to use it in Tomcat or
> > under a specific jserv servlet zone.
> >
> > The problem is that classloader behavior is a real pain in the ass,
> > expecially between 1.1 and 1.2 java versions.
> >
> > But today I'll install tomcat 3.1b and see what happens.
> >
> > --
> > Stefano Mazzocchi      One must still have chaos in oneself to be
> >                           able to give birth to a dancing star.
> > <st...@apache.org>                             Friedrich Nietzsche
> > --------------------------------------------------------------------
> >  Come to the first official Apache Software Foundation Conference!
> > ------------------------- http://ApacheCon.Com ---------------------
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
> --
> Darryl Stoflet
> http://dstoflet.calweb.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Cocoon producers and Tomcat

Posted by Darryl Stoflet <ds...@calweb.com>.
Stephano,

	I sent in a report to bugzilla that I thought addressed this and
offered a remedy. If cocoon is in the classpath (as it is in the
howto installation guides) it will be loaded by the system class
loader, which knows nothing about the web-inf/classes or web-inf/lib
directories. Thus when cocoon trys to load classes or any resource not
in the system classpath it will fail, as the example below does
when a producer is placed in the web-inf/classes directory. 
The 2 solutions are to either place all resources and classes in the
system classpath including cocoon, or put cocoon in a web-inf directory
and then it will be able to see the resources and classes in that 
contexts web-inf/classes and web-inf/lib directory as well as the system
classpath. If you opt to enable placing cocoon in web-inf/classes
you must also refrain from the usage of ClassLoader.getSystemResource()
as it will use the system classloader. Instead use
getClass().getClassLoader().getResource.

/Darryl Stoflet



Stefano Mazzocchi wrote:
> 
> Kevin Jones wrote:
> >
> > if I'm using Cocoon from within Tomcat (the latest 3.1 build). If I add a
> > producer to the cocoon.properties file I get the following
> >
> > java.lang.RuntimeException: Error creating
> > kevinj.develop.util.WeatherProducer: class is not found
> >
> > I've put the class (package and all) under WEB-INF/classes, so the question
> > is, where does Cocoon expect to find the producer class (or am I missing
> > something else?) ?
> 
> I am currently trying to address the classloading/resourceloading
> problems in Cocoon 1.7.1-dev to make it possible to use it in Tomcat or
> under a specific jserv servlet zone.
> 
> The problem is that classloader behavior is a real pain in the ass,
> expecially between 1.1 and 1.2 java versions.
> 
> But today I'll install tomcat 3.1b and see what happens.
> 
> --
> Stefano Mazzocchi      One must still have chaos in oneself to be
>                           able to give birth to a dancing star.
> <st...@apache.org>                             Friedrich Nietzsche
> --------------------------------------------------------------------
>  Come to the first official Apache Software Foundation Conference!
> ------------------------- http://ApacheCon.Com ---------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

-- 
Darryl Stoflet
http://dstoflet.calweb.com

Re: Cocoon producers and Tomcat

Posted by Stefano Mazzocchi <st...@apache.org>.
Kevin Jones wrote:
> 
> if I'm using Cocoon from within Tomcat (the latest 3.1 build). If I add a
> producer to the cocoon.properties file I get the following
> 
> java.lang.RuntimeException: Error creating
> kevinj.develop.util.WeatherProducer: class is not found
> 
> I've put the class (package and all) under WEB-INF/classes, so the question
> is, where does Cocoon expect to find the producer class (or am I missing
> something else?) ?

I am currently trying to address the classloading/resourceloading
problems in Cocoon 1.7.1-dev to make it possible to use it in Tomcat or
under a specific jserv servlet zone.

The problem is that classloader behavior is a real pain in the ass,
expecially between 1.1 and 1.2 java versions.

But today I'll install tomcat 3.1b and see what happens.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------



Re: Cocoon producers and Tomcat

Posted by Stefano Mazzocchi <st...@apache.org>.
Kevin Jones wrote:
> 
> if I'm using Cocoon from within Tomcat (the latest 3.1 build). If I add a
> producer to the cocoon.properties file I get the following
> 
> java.lang.RuntimeException: Error creating
> kevinj.develop.util.WeatherProducer: class is not found
> 
> I've put the class (package and all) under WEB-INF/classes, so the question
> is, where does Cocoon expect to find the producer class (or am I missing
> something else?) ?

After some investigation it seems a bug in Tomcat's classloader since in
JServ works perfectly.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------



Cocoon producers and Tomcat

Posted by Kevin Jones <ke...@develop.com>.
if I'm using Cocoon from within Tomcat (the latest 3.1 build). If I add a
producer to the cocoon.properties file I get the following

java.lang.RuntimeException: Error creating
kevinj.develop.util.WeatherProducer: class is not found

I've put the class (package and all) under WEB-INF/classes, so the question
is, where does Cocoon expect to find the producer class (or am I missing
something else?) ?

Kevin Jones
DevelopMentor
www.develop.com



RE: Embedding XML output of XSP into another XML page?

Posted by Erik Norvelle <er...@norvelle.net>.
Preferred format, mostly, and also where I should send my contributions...

-Erik

> -----Original Message-----
> From: Donald Ball [mailto:balld@webslingerZ.com]
> Sent: Thursday, March 16, 2000 1:45 AM
> To: cocoon-users@xml.apache.org
> Subject: RE: Embedding XML output of XSP into another XML page?
> 
> 
> On Thu, 16 Mar 2000, Erik Norvelle wrote:
> 
> > To Stefano &/or other Cocoon project leads:
> > 
> > If I wanted to contribute something to the documentation, who 
> would I get in
> > touch with.  I wouldn't mind writing bits and pieces regarding the
> > problems/solutions I have come up with...
> 
> Us, of course. Are you looking for suggestions on what to document or for
> the preferred format of the documentation or what?
> 
> - donald
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 

RE: Embedding XML output of XSP into another XML page?

Posted by Donald Ball <ba...@webslingerZ.com>.
On Thu, 16 Mar 2000, Erik Norvelle wrote:

> To Stefano &/or other Cocoon project leads:
> 
> If I wanted to contribute something to the documentation, who would I get in
> touch with.  I wouldn't mind writing bits and pieces regarding the
> problems/solutions I have come up with...

Us, of course. Are you looking for suggestions on what to document or for
the preferred format of the documentation or what?

- donald


RE: Embedding XML output of XSP into another XML page?

Posted by Erik Norvelle <er...@norvelle.net>.
To Stefano &/or other Cocoon project leads:

If I wanted to contribute something to the documentation, who would I get in
touch with.  I wouldn't mind writing bits and pieces regarding the
problems/solutions I have come up with...

-Erik Norvelle

> -----Original Message-----
> From: Stefano Mazzocchi [mailto:stefano@apache.org]
> Sent: Wednesday, March 15, 2000 3:35 PM
> To: cocoon-users@xml.apache.org
> Subject: Re: Embedding XML output of XSP into another XML page?
>
>
> Erik Norvelle wrote:
> >
> > Folks:
> >
> > I have solved this problem...  It turns out I have to insert
> > <xsl:processing-instruction
> >
> name="cocoon-format">type="text/xml"</xsl:processing-instruction> into the
> > XSL sheet for step #1.  This tag apparently goes inside the
> <xsl:template
> > match="/"> tagset, although it may be able to be put elsewhere.
> >
> > As a note to any writers of documentation, it would be a good idea to
> > include a section in the cocoon spec that lists the processing
> instructions
> > that can be sent to Cocoon via the <xsl:processing-instruction>
> tag.  I only
> > found this one by hunting around in the sample files for several hours.
> >
> > Also, there seems to be a problem that this introduces with the
> XSLT spec.
> > It's my impression that use of the <xsl:output method="xml"/> is the
> > recommended way to indicate output preference.  And indeed,
> Xalan appears to
> > honor this tag.  However, Cocoon, when it sends the processed
> file out to
> > the client, prepends a <!DOCTYPE HTML PUBLIC> declaration to
> the top of the
> > file, ignoring the output type that the xsl file requested.  It
> seems to me
> > that Cocoon should honor the output type that Xalan produces,
> marking it as
> > HTML iff (if and only if) the xsl sheet has specified html via the
> > <xsl:output> tag.
> >
> > For what it's worth...
>
> xsl:output is a hack, exactly like ?cocoon-format? so we should get rid
> of both of them starting from Cocoon2.
>
> About the docs, any help to improve them will be greatly appreciated :)
>
> --
> Stefano Mazzocchi      One must still have chaos in oneself to be
>                           able to give birth to a dancing star.
> <st...@apache.org>                             Friedrich Nietzsche
> --------------------------------------------------------------------
>  Come to the first official Apache Software Foundation Conference!
> ------------------------- http://ApacheCon.Com ---------------------
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


Re: Embedding XML output of XSP into another XML page?

Posted by Stefano Mazzocchi <st...@apache.org>.
Erik Norvelle wrote:
> 
> Folks:
> 
> I have solved this problem...  It turns out I have to insert
> <xsl:processing-instruction
> name="cocoon-format">type="text/xml"</xsl:processing-instruction> into the
> XSL sheet for step #1.  This tag apparently goes inside the <xsl:template
> match="/"> tagset, although it may be able to be put elsewhere.
> 
> As a note to any writers of documentation, it would be a good idea to
> include a section in the cocoon spec that lists the processing instructions
> that can be sent to Cocoon via the <xsl:processing-instruction> tag.  I only
> found this one by hunting around in the sample files for several hours.
> 
> Also, there seems to be a problem that this introduces with the XSLT spec.
> It's my impression that use of the <xsl:output method="xml"/> is the
> recommended way to indicate output preference.  And indeed, Xalan appears to
> honor this tag.  However, Cocoon, when it sends the processed file out to
> the client, prepends a <!DOCTYPE HTML PUBLIC> declaration to the top of the
> file, ignoring the output type that the xsl file requested.  It seems to me
> that Cocoon should honor the output type that Xalan produces, marking it as
> HTML iff (if and only if) the xsl sheet has specified html via the
> <xsl:output> tag.
> 
> For what it's worth...

xsl:output is a hack, exactly like ?cocoon-format? so we should get rid
of both of them starting from Cocoon2.

About the docs, any help to improve them will be greatly appreciated :)

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------



RE: Embedding XML output of XSP into another XML page?

Posted by Erik Norvelle <er...@norvelle.net>.
Folks:

I have solved this problem...  It turns out I have to insert
<xsl:processing-instruction
name="cocoon-format">type="text/xml"</xsl:processing-instruction> into the
XSL sheet for step #1.  This tag apparently goes inside the <xsl:template
match="/"> tagset, although it may be able to be put elsewhere.

As a note to any writers of documentation, it would be a good idea to
include a section in the cocoon spec that lists the processing instructions
that can be sent to Cocoon via the <xsl:processing-instruction> tag.  I only
found this one by hunting around in the sample files for several hours.

Also, there seems to be a problem that this introduces with the XSLT spec.
It's my impression that use of the <xsl:output method="xml"/> is the
recommended way to indicate output preference.  And indeed, Xalan appears to
honor this tag.  However, Cocoon, when it sends the processed file out to
the client, prepends a <!DOCTYPE HTML PUBLIC> declaration to the top of the
file, ignoring the output type that the xsl file requested.  It seems to me
that Cocoon should honor the output type that Xalan produces, marking it as
HTML iff (if and only if) the xsl sheet has specified html via the
<xsl:output> tag.

For what it's worth...

-Erik Norvelle

> -----Original Message-----
> From: Erik Norvelle [mailto:erik@norvelle.net]
> Sent: Saturday, March 11, 2000 3:31 AM
> To: Cocoon Users
> Subject: Embedding XML output of XSP into another XML page?
>
>
> Folks:
>
> I have recently gotten Cocoon installed, and it works great.  However, I
> appear to have run into a roadblock.
>
> Here is what I need to do:
>
> 1) A Cocoon SQL page returns a rowset, which I format with the
> <?cocoon-format ?> PI and an XSLT stylesheet, to return some "nice" XML
> (as opposed to the rather ugly raw resultset coming directly from the
> <query> tag.
> 2) I use a DTD ELEMENT declaration to insert the resulting document
> (referenced via http, so that Cocoon does the appropriate
> pre-processing) into my master XML document.  This document then gets
> processed by a second XSLT transform, with the end result needing to be
> in HTML.
>
> The problem?  The page that results from step 1 *always* has a the
> following doctype inserted:  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
> 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">.  Needless to
> say, Cocoon chokes on this, because it wants only entities or CDATA
> being inserted as a result of the element's expansion.
>
> I have tried to use the <xsl:output method="xml"/> tag in the stylesheet
> that transforms step #1, but to no avail.  Nothing I have done can
> suppress the DOCTYPE declaration from being inserted.
>
> I can get around this by eliminating the XSLT transform in step #1, but
> this causes problems later, by unnecesarily complicating the transform
> that I have to do in step #2.  I want the XML that gets inserted to be
> as clean as I can make it, so that my XSLT sheets don't get hideously
> complex.
>
> Am I missing something dreadfully obvious?  Or am I barking up the wrong
> tree altogether?
>
> -Erik Norvelle
> erik@norvelle.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>