You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by shivakumar <a....@welcome-rt.com> on 2003/11/13 03:16:37 UTC
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/section[@class='BodyPage']/table[1]/row[@class='Result
SetHeaderRow']"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[2]/row[@class='Result
SetRow']"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[2]/row[@class='Result
SetRow_Empty']"/>
</redirect:write>
<redirect:close file="../webapps/xls/result.xml"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[1]/row[@class='Result
SetHeaderRow']"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[2]/row[@class='Result
SetRow']"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[2]/row[@class='Result
SetRow_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>
RE: not generation xml file
Posted by shivakumar <a....@welcome-rt.com>.
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/section[@class='BodyPage']/table[1]/row[@class='Result
SetHeaderRow']"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[2]/row[@class='Result
SetRow']"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[2]/row[@class='Result
SetRow_Empty']"/>
</source:write>
</xsl:template>
</xsl:stylesheet>
sitemap.xmap source
<map:transformer name="filewriter"
src="org.apache.cocoon.transformation.SourceWritingTransformer"/>
pipeline
<map:when test="xml">
<map:generate type="serverpages"
src="content/resultset/{../../1}.resultset.xsp"/>
<map:transform
src="stylesheets/resultset/xml/{../../1}.resultset2xml.xsl"/>
<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:conalt@paradise.net.nz]
Sent: Thursday, November 13, 2003 11:17 AM
To: users@cocoon.apache.org
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.
Cheers
Con
-----Original Message-----
From: shivakumar [mailto:a.shivakumar@welcome-rt.com]
Sent: Thursday, 13 November 2003 15:17
To: users@cocoon.apache.org
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/section[@class='BodyPage']/table[1]/row[@class='Result
SetHeaderRow']"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[2]/row[@class='Result
SetRow']"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[2]/row[@class='Result
SetRow_Empty']"/>
</redirect:write>
<redirect:close file="../webapps/xls/result.xml"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[1]/row[@class='Result
SetHeaderRow']"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[2]/row[@class='Result
SetRow']"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[2]/row[@class='Result
SetRow_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>
RE: not generation xml file
Posted by Conal Tuohy <co...@paradise.net.nz>.
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.
Cheers
Con
-----Original Message-----
From: shivakumar [mailto:a.shivakumar@welcome-rt.com]
Sent: Thursday, 13 November 2003 15:17
To: users@cocoon.apache.org
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/section[@class='BodyPage']/table[1]/row[@class='ResultSetH
eaderRow']"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[2]/row[@class='ResultSetR
ow']"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[2]/row[@class='ResultSetR
ow_Empty']"/>
</redirect:write>
<redirect:close file="../webapps/xls/result.xml"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[1]/row[@class='ResultSetH
eaderRow']"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[2]/row[@class='ResultSetR
ow']"/>
<xsl:apply-templates
select="/document/section[@class='BodyPage']/table[2]/row[@class='ResultSetR
ow_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>