forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: xml-forrest/src/resources/library/xslt html2htmlbody.xsl
Date Sat, 25 Jan 2003 10:39:41 GMT
jefft       2003/01/25 02:39:41

  Modified:    src/resources/conf sitemap.xmap
               src/resources/fresh-site/src/documentation/content/xdocs
                        site.xml
  Added:       src/resources/fresh-site/src/documentation/content/xdocs
                        html-sample.html
               src/resources/library/xslt html2htmlbody.xsl
  Log:
  Proposed content/xdocs/*.html sample
  
  Revision  Changes    Path
  1.58      +19 -1     xml-forrest/src/resources/conf/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/conf/sitemap.xmap,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- sitemap.xmap	23 Jan 2003 17:39:19 -0000	1.57
  +++ sitemap.xmap	25 Jan 2003 10:39:41 -0000	1.58
  @@ -438,7 +438,7 @@
   
   <!-- Generates body HTML for files in subdirs -->
            <map:match pattern="body-**/*.xml">
  -<!-- if the file is present as ihtml, give that to the user... -->
  +           <!-- if the file is present as ihtml, convert to doc-v11... -->
               <map:act type="resource-exists">
                  <map:parameter name="url" value="content/xdocs/{1}/{2}.ihtml" />
   
  @@ -457,6 +457,15 @@
                  </map:call>
               </map:act>
   
  +            <!-- if the file is present as html, give that to the user... -->
  +            <map:act type="resource-exists">
  +               <map:parameter name="url" value="content/xdocs/{1}/{2}.html" />
  +               <map:generate src="content/xdocs/{../1}/{../2}.html"/>
  +               <map:transform src="library/xslt/html2htmlbody.xsl" />
  +               <map:transform type="linkrewriter" src="cocoon:/linkmap" />
  +               <map:serialize type="xml"/>
  +            </map:act>
  +
   <!-- if the file is present as .cwiki, give that to the user... -->
               <map:act type="resource-exists">
                  <map:parameter name="url" value="content/xdocs/{1}/{2}.cwiki" />
  @@ -520,6 +529,15 @@
   
                     <map:parameter name="path" value="{../1}.xml" />
                  </map:call>
  +            </map:act>
  +
  +            <!-- if the file is present as html, give that to the user... -->
  +            <map:act type="resource-exists">
  +               <map:parameter name="url" value="content/xdocs/{1}.html" />
  +               <map:generate src="content/xdocs/{../1}.html"/>
  +               <map:transform src="library/xslt/html2htmlbody.xsl" />
  +               <map:transform type="linkrewriter" src="cocoon:/linkmap" />
  +               <map:serialize type="xml"/>
               </map:act>
   
   <!-- if the file is present as .cwiki, give that to the user... -->
  
  
  
  1.5       +2 -0      xml-forrest/src/resources/fresh-site/src/documentation/content/xdocs/site.xml
  
  Index: site.xml
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/fresh-site/src/documentation/content/xdocs/site.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- site.xml	15 Jan 2003 11:55:33 -0000	1.4
  +++ site.xml	25 Jan 2003 10:39:41 -0000	1.5
  @@ -23,6 +23,8 @@
         <section href="#section"/>
         <ihtml label="iHtml" href="test.html"/>
       </sample>
  +    <sample-ihtml label="Sample ihtml page" href="ihtml-sample.html"/>
  +    <sample-ihtml label="Sample html page" href="html-sample.html"/>
       <changes label="Changes" href="changes.html"/>
       <todo label="Todo" href="todo.html"/>
     </about>
  
  
  
  1.1                  xml-forrest/src/resources/fresh-site/src/documentation/content/xdocs/html-sample.html
  
  Index: html-sample.html
  ===================================================================
  <html>
    <!-- Note: no head element or external CSS refs.  Elements outside the body are ignored
-->
    <body>
      <h1>Sample HTML page</h1>
      <p>
      This HTML page body is copied across directly from
      <tt>src/documentation/content/xdocs</tt>. Only the menus and tabs are added
      by Forrest.
      </p>
      <p>
      Using raw HTML like this is not recommended, because the advantages of
      separating content from presentation are lost.  In particular, Forrest
      can't generate PDFs of this page.
      </p>
      <p>
      Still, there are many cases when the Forrest DTD isn't sufficient, such as
      when you want to embed applets, <a href="javascript:alert('Opened with         Javascript')">Javascript</a>,
  	<table cellpadding="5">
  		<tr bgcolor="#aaffff">
  			<td>Tables</td><td>
  				<table>
  					<tr>
  						<td bgcolor="#ffffaa">within</td>
  						<td bgcolor="ffaaff">tables</td>
  					</tr>
  				</table>
  			</td>
  		</tr>
  	</table>
  	HTML Forms:
  	<form>
  		<select name="skin">
  			<option value="krysalis-site">krysalis-site</option>
  			<option value="forrest-site">forrest-site</option>
  		</select>
      <input type="submit" value="Change Skin (temporarily, in the webapp)"/>
  	</form>
  	and other HTML <blink>delights</blink>
  
      </p>
      <p>
      You can still take advantage of Forrest's <a href="http://xml.apache.org/forrest/linking.html">site:
linking</a>, eg
      <a href="index.html">&lt;a href="site:index"&gt;</a>
      </p>
    </body>
  </html>
  
  
  
  1.1                  xml-forrest/src/resources/library/xslt/html2htmlbody.xsl
  
  Index: html2htmlbody.xsl
  ===================================================================
  <?xml version="1.0"?>
  <!--
  Stylesheet which strips everything outside the <body> and replaces it with <div
  class="content">, making raw HTML suitable for merging with the Forrest tabs
  and menu.
  -->
  
  <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
  
    <xsl:import href="copyover.xsl"/>
    <xsl:template match="/html">
      <xsl:apply-templates select="body"/>
    </xsl:template>
  
    <xsl:template match="/html/body">
      <div class="content">
        <xsl:apply-templates/>
      </div>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  

Mime
View raw message