forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gav...." <brightoncomput...@brightontown.com.au>
Subject RE: Own type of documen transformed to document-v20
Date Sun, 14 May 2006 09:04:29 GMT


> -----Original Message-----
> From: Cameron McCormack [mailto:cam@mcc.id.au]
> Sent: Sunday, 14 May 2006 3:33 PM
> To: user@forrest.apache.org
> Subject: Own type of documen transformed to document-v20
> 
> Hi.
> 
> I'd like to have my own document format that can be transformed into
> document-v20 (and subsequently into HTML).

Why do you want to do that, do you need to over-ride or replace 
Document-v20 elements? 

I think what you could be looking at doing is including document-v20
And then adding any specific ones for yourself into your Document-v01
(Actually , looking at it this should be Status-v01)

What you are missing at this stage is the actual DTD and MOD files
 That contain your definitions.

So, you need to create status-v01.dtd and status-v01.mod.

These need to go in a /resources/schema/ directory.

Take a look at /main/webapp/resources/schema/dtd/v20a/ and look at 
The document-v20.dtd and document-v20.mod as examples, create your
Own status.dtd and status.mod.

Also look in the whiteboard plugins, there are some good examples
In there.

Gav... 


> 
> <!DOCTYPE status SYSTEM "-//Test//DTD Status Document V0.1//EN">
> <status>
>   <header>
>     <title>Batik conformance status</title>
>   </header>
> 
>   <body>
>     ...
>     <elements>
>       ...
>     </elements>
>     ...
>   </body>
> </status>
> 
> Previously, I didn't have a sitemap.xmap file.  I think I need one now,
> so I've tried one with this content (adapted from the example given when
> you do a 'forrest seed'):
> 
>   <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
> 
>     <map:components>
>       <map:actions>
>         <map:action logger="sitemap.action.sourcetype" name="sourcetype"
> src="org.apache.forrest.sourcetype.SourceTypeAction">
>           <sourcetype name="status-v0.1">
>             <document-declaration public-id="-//Test//DTD Status Document
> V0.1//EN" />
>           </sourcetype>
>         </map:action>
>       </map:actions>
> 
>       <map:selectors default="parameter">
>         <map:selector logger="sitemap.selector.parameter" name="parameter"
> src="org.apache.cocoon.selection.ParameterSelector" />
>       </map:selectors>
>     </map:components>
> 
>     <map:resources>
>       <map:resource name="transform-to-document">
>         <map:act type="sourcetype" src="{src}">
>           <map:select type="parameter">
>             <map:parameter name="parameter-selector-test"
> value="{sourcetype}" />
> 
>             <map:when test="status-v0.1">
>               <map:generate src="{project:content.xdocs}{../../1}.xml" />
>               <map:transform
> src="{project:resources.stylesheets}/status2document.xsl" />
>               <map:serialize type="xml-document"/>
>             </map:when>
>           </map:select>
>         </map:act>
>       </map:resource>
>     </map:resources>
> 
>     <map:pipelines>
>       <map:pipeline>
>         <map:match pattern="**.xml">
>           <map:call resource="transform-to-document">
>             <map:parameter name="src"
> value="{project:content.xdocs}{1}.xml" />
>           </map:call>
>         </map:match>
>       </map:pipeline>
>     </map:pipelines>
>   </map:sitemap>
> 
> Actually I have no idea what I'm doing in this sitemap.xmap file; I just
> tried to adjust the example one as little as possible for my situation.
> 
> I've also put a file called status2document.xml file in
> resources/stylesheets, with this content:
> 
>   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
>     <xsl:template match="/">
>       <document>
>         <xsl:apply-templates select="*/node()"/>
>       </document>
>     </xsl:template>
> 
>     <xsl:template match="*">
>       <xsl:copy>
>         <xsl:copy-of select="@*"/>
>         <xsl:apply-templates selcet="node()"/>
>       </xsl:copy>
>     </xsl:template>
> 
>     <xsl:template match="elements">
>       <p>THIS IS WHERE THE ELEMENTS GO</p>
>     </xsl:template>
>   </xsl:stylesheet>
> 
> just as a minimal stylesheet to get me started.  (It should copy all
> elements over, except the "elements" element, that gets special
> treatment.)
> 
> When I try to view status.html after running 'forrest run', I get an
> Internal Server Error that says:
> 
>   /tmp/batik-forrest/src/documentation/content/xdocs/-/Test/DTD Status
> Document V0.1/EN (No such file or directory)
> 
> Can someone please tell me where I'm going wrong?
> 
> Thanks,
> 
> Cameron
> 
> --
>  Cameron McCormack			ICQ: 26955922
>  cam (at) mcc.id.au			MSN: cam (at) mcc.id.au
>  http://mcc.id.au/			JBR: heycam (at) jabber.org
> 
> 
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.392 / Virus Database: 268.5.6/338 - Release Date: 12/05/2006



Mime
View raw message