Help needed with debugging XSP

2001-12-14 Thread Adam A R

Hello all,

I am using Cocoon 1.8 with iAWS server.

I have the following flow in my application.

XML - XSP - XSLT

XML file processed by XSP(actually an XSL) to add dynamic content. The
output of which is transformed by a Stylsheet and the result returned
to the user.

Now, I want to look at the output generated by the XSP.

How can I do that??

Thanks in advance for all the help.

cheers
Adam


-
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: Help needed with debugging XSP

2001-12-14 Thread David Rosenstrauch

Note:  This response contains C2 terminology (e.g., transformer, serializer).  
You'll have to convert to C1 terminology yourself.

Some options:

1) Insert a log transformer after the XSP page.  That will output the SAX events from 
the XSP page to a log file.

2) Instead of running the XSLT, modify your site to serialize the output right after 
the XSP file.  Either:
 * set the output for download (set a request header of:  Content-disposition: 
attachment; filename=...), or
 * declare a new serializer that uses the XMLSerializer, but with mime type 
text/plain, or
 * just output as regular XML, and use Microsoft IE to view the doc.  It 
supports XML display.


DR



At 05:05 PM 12/14/01 +0900, you wrote:
Hello all,

I am using Cocoon 1.8 with iAWS server.

I have the following flow in my application.

XML - XSP - XSLT

XML file processed by XSP(actually an XSL) to add dynamic content. The
output of which is transformed by a Stylsheet and the result returned
to the user.

Now, I want to look at the output generated by the XSP.

How can I do that??

Thanks in advance for all the help.

cheers
Adam


-
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: Help needed with debugging XSP

2001-12-14 Thread Jeff Turner

On Fri, Dec 14, 2001 at 05:05:44PM +0900, Adam A R wrote:
 Hello all,
 
 I am using Cocoon 1.8 with iAWS server.
 
 I have the following flow in my application.
 
 XML - XSP - XSLT
 
 XML file processed by XSP(actually an XSL) to add dynamic content. The
 output of which is transformed by a Stylsheet and the result returned
 to the user.
 
 Now, I want to look at the output generated by the XSP.

Just remove the ?cocoon-process type=xslt? PI, and change the MIME
type specified in cocoon-format to text/xml. So at the top of your XML
you'd have:

?cocoon-process type=xsp?
?cocoon-format type=text/xml?

You could also leave the XSLT processor in place, but use either:

 -  an identity transform stylesheet that doesn't alter the incoming
XML,
 -  a stylesheet that pretty-prints the XML for viewing in the browser
(like IE does).

I've attached a simple identity transform xsl. You can find a good view
XML as HTML stylesheet in xml-xalan/java/samples/servlet/default.xsl

When developing, I like to be able to switch to the debug stylesheet
without editing XSPs. You can dynamically select the applied stylesheet
with an XSP like this:

?cocoon-process type=xsp?
?cocoon-process type=xslt?
xsp:page language=java
xmlns:request=http://www.apache.org/1999/XSP/Request;
xmlns:xsp=http://www.apache.org/1999/XSP/Core;
xmlns:util=http://www.apache.org/1999/XSP/Util;
page
xsp:pi target=xml-stylesheethref=
xsp:expr
  request:get-parameter name=ss default=normal.xsl /
/xsp:expr
 type=text/xsl/xsp:pi

/page
/xsp:page

Then by default, normal.xsl will be applied, but if you append
?ss=identity.xsl, you'll get identity.xsl applied instead.


--Jeff

 cheers
 Adam


?xml version=1.0?

!-- An identity transformation
 [EMAIL PROTECTED]
 --
xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xsl:output method=xml media-type=text/xml indent=yes/

xsl:template match=/
  xsl:copy-of select=node()/
/xsl:template

/xsl:stylesheet



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