cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kieran Kirwan" <KKir...@dto.ie>
Subject RE: Writing plain text files?
Date Tue, 28 Oct 2003 17:35:54 GMT
Try these,

----------------------------------------------------------------
[sitemap.xmap]
	<map:match pattern="blahblah">
		<map:generate src="blahblah.xml"/>
		<map:transform type="xslt" src="blahblah.xsl"/>
		<map:serialize type="text"/>
	</map:match>

----------------------------------------------------------------
[blahblah.xml]

<?xml version="1.0"?>
<page>
<line> bla bla bla bla bla bla </line>
<line> murmel murmel murmel </line>
</page>

-----------------------------------------------------------------
[blahblah.xsl]

<?xml version="1.0"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:template match="/">
<xsl:text>#-----Beginning of text file--------
</xsl:text>
<xsl:for-each select="page/line">   <!-- matches data in nodes.xml -->
<xsl:value-of select="."/>
<xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:text>#-----End of text file--------
</xsl:text>
</xsl:template>

</xsl:stylesheet>
-----------------------------------------------------------------



_____________________________________________
Kieran Kirwan
Executive Transportation Planner
Transportation Modelling Department
 
Dublin Transportation Office
Hainault House,
69/71 St. Stephen's Green,
Dublin 2,
Ireland.
Tel: +353 (0)1 4778113
Fax: +353 (0) 1 478 5935
website: www.dto.ie <http://www.dto.ie/>  
 



-----Original Message-----
From: McDonald, Bruce [mailto:Bruce.McDonald@bankofamerica.com]
Sent: 28 October 2003 17:24
To: users@cocoon.apache.org
Subject: RE: Writing plain text files?


For excellent examples of doing this with XSLT, look at the OReilly XSLT Cookbook.

-----Original Message-----
From: Joerg Heinicke [mailto:jheinicke@virbus.de]
Sent: Tuesday, October 28, 2003 12:19 PM
To: users@cocoon.apache.org
Subject: Re: Writing plain text files?


On 28.10.2003 15:44, Jorg Heymans wrote:

> why not write your own transformer ?

At the end it's only a simple stylesheet.

Joerg

> Stephanie Zohner wrote:
> 
>> Hi,
>>
>> I want to write plain text files with Cocoon, What's the best way to do
>> this?
>>
>> The task sounds simple, but for me, it turned out to be quite tricky.
>>
>> So far I have tried with the SourceWriteTransformer. However, it still
>> requires at least a root tag for its output.
>> Another problem ist, that I need line breaks in my output text file and I
>> don't know, how to tell the XSLT Processor to do this.
>>
>> To make myself a bit clearer:
>> I would like to turn an XML-fragment like this,
>>
>> <page>
>> <line> bla bla bla bla bla bla </line>
>> <line> murmel murmel murmel </line>
>> </page>
>>
>> into:
>>
>> #-----Beginning of text file--------
>>
>> bla bla bla bla bla bla murmel murmel murmel
>> #-----End of text file---------------
>>
>> Does anybody have an idea?
>>
>> Thanks,
>>
>> Stephanie


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
Mail Marshal for the presence of computer viruses.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message