Hi,
I modified to
SourceWritingTransformer. Still it is not generating any xml file.
Here is the xls
source.
<?xml
version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsp="http://apache.org/xsp"
>
<xsl:template
match="xsp:page">
<source:write
xmlns:source="http://apache.org/cocoon/source/1.0"
create="true" >
<source:source>context://my.xml</source:source>
<xsl:apply-templates
select="/document/[EMAIL PROTECTED]'BodyPage']/table[1]/[EMAIL PROTECTED]'ResultSetHeaderRow']"/>
<xsl:apply-templates select="/document/[EMAIL PROTECTED]'BodyPage']/table[2]/[EMAIL PROTECTED]'ResultSetRow']"/>
<xsl:apply-templates select="/document/[EMAIL PROTECTED]'BodyPage']/table[2]/[EMAIL PROTECTED]'ResultSetRow_Empty']"/>
</source:write>
</xsl:template>
</xsl:stylesheet>
sitemap.xmap
source
<map:transformer
name="filewriter"
src="">
pipeline
<map:when
test="xml">
<map:generate
type="serverpages" src="">
<map:transform
src="">
<map:parameter
name="view-source" value="content/resultset/{../../1}.resultset.xsp"/>
<map:transform type="filewriter"/>
<map:serialize
type="xml"/>
</map:when>
what’s the
error in this code. Help me if any one knows.
Thanks,
Shiva
-----Original Message-----
From: Conal Tuohy
[mailto:[EMAIL PROTECTED]
Sent: Thursday, November 13, 2003
11:17 AM
To: [EMAIL PROTECTED]
Subject: RE: not generation xml
file
Shiva, I think
the xalan redirect extension may not work within Cocoon. To conform to the
Cocoon "best practice", you should use a separate pipeline stage to
save the XML data to a file on the server. Use the SourceWritingTransformer for
this purpose.
-----Original Message-----
From: shivakumar
[mailto:[EMAIL PROTECTED]
Sent: Thursday, 13 November 2003
15:17
To: [EMAIL PROTECTED]
Subject: not generation xml file
Hi
Using the above
code I am able to display the xml on the browser, but it is not generating the
xml output file in my local server, what’s wrong in this code. Any
one help me.
Thanks
Shiva
This is my xls
file.
<?xml
version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:xsp="http://apache.org/xsp"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:redirect="org.apache.xalan.lib.Redirect"
extension-element-prefixes="redirect">
<xsl:output
method="xml" encoding="UTF-8"/>
<xsl:template match="xsp:page">
<redirect:open
file="../webapps/xls/result.xml"/>
<redirect:write file="../webapps/xls/result.xml">
<xsl:apply-templates
select="/document/[EMAIL PROTECTED]'BodyPage']/table[1]/[EMAIL PROTECTED]'ResultSetHeaderRow']"/>
<xsl:apply-templates
select="/document/[EMAIL PROTECTED]'BodyPage']/table[2]/[EMAIL PROTECTED]'ResultSetRow']"/>
<xsl:apply-templates select="/document/[EMAIL PROTECTED]'BodyPage']/table[2]/[EMAIL PROTECTED]'ResultSetRow_Empty']"/>
</redirect:write>
<redirect:close
file="../webapps/xls/result.xml"/>
<xsl:apply-templates select="/document/[EMAIL PROTECTED]'BodyPage']/table[1]/[EMAIL PROTECTED]'ResultSetHeaderRow']"/>
<xsl:apply-templates
select="/document/[EMAIL PROTECTED]'BodyPage']/table[2]/[EMAIL PROTECTED]'ResultSetRow']"/>
<xsl:apply-templates select="/document/[EMAIL PROTECTED]'BodyPage']/table[2]/[EMAIL PROTECTED]'ResultSetRow_Empty']"/>
</xsl:template>
<!--
***************** !DO NOT CHANGE! Standard Templates ***************** -->
<xsl:template name="get-nested-content">
<xsl:param name="content"/>
<xsl:choose>
<xsl:when test="$content/*">
<xsl:apply-templates select="$content/*"/>
</xsl:when>
<xsl:otherwise>"<xsl:value-of
select="$content"/>"</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="@*|*|text()|processing-instruction()">
<xsl:copy>
<xsl:apply-templates
select="@*|*|text()|processing-instruction()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>