Dave,
I simplify a lot the code.
The EOL charactre was due a problem on the format of your files (dos).
There is not need to use chaperon format, you get a <text> </text> from
the Cocoon TextGenerator.
Please, would you mind text the changes so it works for you as well?
Cheers
Cheche
cheche@apache.org wrote:
> cheche 2003/07/17 17:17:23
>
> Modified: src/resources/conf forrest.xmap
> Added: src/resources/stylesheets text2document.xsl
> Log:
>
>
> Revision Changes Path
> 1.21 +11 -1 xml-forrest/src/resources/conf/forrest.xmap
>
> Index: forrest.xmap
> ===================================================================
> RCS file: /home/cvs/xml-forrest/src/resources/conf/forrest.xmap,v
> retrieving revision 1.20
> retrieving revision 1.21
> diff -u -r1.20 -r1.21
> --- forrest.xmap 5 Jul 2003 13:01:02 -0000 1.20
> +++ forrest.xmap 18 Jul 2003 00:17:23 -0000 1.21
> @@ -201,6 +201,16 @@
> </map:match>
> </map:when>
>
> + <map:when test="content/{1}.txt">
> + <map:match type="regexp" pattern="^(.*?)([^/]*).xml$">
> + <map:generate type="text2xml" src="content/{1}{2}.txt" />
> + <map:transform src="resources/stylesheets/text2document.xsl">
> + <map:parameter name="filename" value="{2}" />
> + </map:transform>
> + <map:serialize type="xml"/>
> + </map:match>
> + </map:when>
> +
> <map:otherwise>
> <map:generate src="content/xdocs/{1}.xml" />
> <map:call resource="transform-to-document">
>
>
>
> 1.1 xml-forrest/src/resources/stylesheets/text2document.xsl
>
> Index: text2document.xsl
> ===================================================================
> <?xml version="1.0"?>
>
> <!--+
> | Transforms TextGenerator output to document format.
> |
> | CVS $Id: text2document.xsl,v 1.1 2003/07/18 00:17:23 cheche Exp $
> +-->
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <xsl:output indent="yes"
> method="xml"
> doctype-public="-//APACHE//DTD Documentation V1.2//EN"
> doctype-system="document-v12.dtd"
> cdata-section-elements="source"/>
>
> <xsl:param name="filename"/>
>
> <xsl:template match="/">
> <document>
> <header>
> <title>
> <xsl:value-of select="$filename"/>
> </title>
> </header>
> <body>
> <source>
> <xsl:value-of select="node()"/>
> </source>
> </body>
> </document>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
>
|