cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerardo_Flo...@mckinsey.com
Subject Please help with SourceWritingTransformer
Date Thu, 11 Jul 2002 15:10:00 GMT

I seem to have done everything right and was testing out the
SourceWritingTransformer and can't get it to write to a file.  I have the
pipeline

<map:match pattern="test/*.xsp">
      <map:generate type ="serverpages" src="test/{1}.xsp"/>
      <map:transform type="sql">
          <map:parameter name="use-connection" value="dev_database"/>
      </map:transform>
      <map:transform src="test/metadata.xsl"/>
      <map:transform type="xslt-with-parameters" src="test/source.xsl">
          <map:parameter name="page-title" value="{page-title}"/>
      </map:transform>
      <map:transform type="tofile2">
          <map:parameter name="serializer" value="xml"/>
      </map:transform>
      <map:serialize type="xml"/>
   </map:match>


I know that everything up to the second transformation works (until the
tofile2 trans which is the SWT).  The input to the SWT looks like this:

<?xml version="1.0" encoding="UTF-8" ?>
   <source:write xmlns:source="http://apache.org/cocoon/source/1.0" src="
   context://my.xml">
      <KnowledgeObject xmlns:sql="http://apache.org/cocoon/SQL/2.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     .......stuff..........
     </KnowledgeObject>
    </source:write>

The error I get is:
<?xml version="1.0" encoding="UTF-8" ?>
<source:write src="file:C:\jakarta-tomcat-3.2.4\webapps\cocoon\my.xml"
action="none" result="failed" serializer="xml" xmlns:source="
http://apache.org/cocoon/source/1.0">The src attribute doesn't resolve to a
writeable source and failed to cancel
</source:write>

   not sure what I am doing wrong???  Could anyone enlighten me?  It seems
   as though the file:C:\jakarta-tomcat-3.2.4\webapps\cocoon\my.xml is
   badly formed, but this path gets generated by the SWT as what I hard
   coded into the xsl sheet is below:


<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version
="1.0"
               xmlns:source="http://apache.org/cocoon/source/1.0">
    <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
    <xsl:strip-space elements="*"/>

    <xsl:template match="/">
        <xsl:element name="source:write">
            <xsl:attribute name="src">context://my.xml</xsl:attribute>
            <xsl:copy-of select="."/>
        </xsl:element>
    </xsl:template>
</xsl:transform>


Am I using the SWT wrong?  I'm a newbie to Cocoon and have tried everything
that I know how to do, so any help would be greatly appreciated!!

-Gerardo

+---------------------------------------------------------+
This message may contain confidential and/or privileged
information.  If you are not the addressee or authorized to
receive this for the addressee, you must not use, copy,
disclose or take any action based on this message or any
information herein.  If you have received this message in
error, please advise the sender immediately by reply e-mail
and delete this message.  Thank you for your cooperation.
+---------------------------------------------------------+


---------------------------------------------------------------------
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message