cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From funing <fun...@necas.nec.co.jp>
Subject Why insert tag of SourceWritingTransformer doesn't work?
Date Wed, 25 Sep 2002 09:06:29 GMT
Hi!
  Does anyone have tried SourceWritingTransformer?
I copy the sample code from http://xml.apache.org/cocoon/userdocs/transf
ormers/sourcewriting-transformer.html to my test1.xml and found that "insert"
tag doesn't work. Why?

This is test1.xml:
> mount/editor/tests/test1.xml 
> <page>
> 	<title>SourceWritingTransformer Test Page 1</title>
> 	<content>
> 		<para><b>Test</b>: Basic</para>
> 		<para>This test should have written a file called result1.xml, in the same directory
as this.</para>
> 		<para>The file's content should come from the xml below.</para>
> 		<para>The XML is:</para>
> 		<para>
> 			<pre>
> 	<source:write src="tests/result1.xml">
> 		<page>
> 			<title>SourceWritingTransformer Test Result 1</title>
> 			<content>
> 				<para>Congratulations!</para>
> 			</content>
> 		</page>
> 	</source:write>
> 			</pre>
> 		</para>
> 	
> <source:write src="tests/result1.xml">
> <page>
> 	<title>SourceWritingTransformer Test Result 1</title>
> 	<content>
> 		<para>Congratulations!</para>
> 	</content>
> </page>
> </source:write>
> 
> 
>    <source:insert src="tests/result1.xml">
>      <source:path>page/content</source:path>      
>      <source:fragment>
>        <p>This paragraph gets <emp>inserted</emp>.</p>
>        <p>With this one, at the end of the content.</p>
>      </source:fragment>
>    </source:insert>
> 	
> 	<source:insert>
> 		<source:path>page/content</source:path>      
> 		<source:source>tests/result1.xml</source:source>
> 		<source:fragment>
> 		       <p>This paragraph gets <emp>inserted</emp>.</p>
> 		       <p>With this one, at the end of the content.</p>
> 		</source:fragment>
> 	</source:insert>
> 
> 
> 		<para>Have a <a href="../result/1">look!</a></para>
> 	</content>
> </page>
> 


This is the result page:
> SourceWritingTransformer Test Page 1 
> Test: Basic
> 
> This test should have written a file called result1.xml, in the same directory as this.
> 
> The file's content should come from the xml below.
> 
> The XML is:
......
......
......
> Result success 
> Source file:/D:/jakarta-tomcat-4.0.1/webapps/cocoon/mount/editor/tests/result1.xml 
> Action Existing file overwritten 
> Serializer my-xml-serializer 
> page/content 
> This paragraph gets inserted.
> 
> With this one, at the end of the content.
> 
> page/content tests/result1.xml 
> This paragraph gets inserted.
> 
> With this one, at the end of the content.
> 
> Have a look! 

-- 
funing <funing@necas.nec.co.jp>


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