<?xml version="1.0"?>
<page-content>
<p>
This application for offline generation.
From xml documents by xslt transformation.
</p>
<p>
<sectionList/>
</p>
<section id="run" name="How to run" level="1"/>
<p>
To generate run script <code>generateSite.php</code> in directory
<code>bin</code>. Output are stored in directory <code>output</code>.
</p>
<p>
You can use <code>php4.0 xslt function</code> or <code>php4.3 xslt function</code>
only copy file <code>XSLT.php.40</code> or <code>XSLT.php.43</code> to
<code>XSLT.php</code> file.
</p>
<section id="dirs" name="Directory structure" level="1"/>
<p>
Dir structure:
<pre>
bin/ - script for generation
content/ - content for site
db-xml/
common.xml - common information
about site: year, name, email
news.xml - news of site, are showed
on first page
pages.xml - list of site's pages
pages/ - directory with page's content
fp.xml - first page
about.xml - this page <smile/>
...
xslt/
other/
pages2text.xsl - xslt for load array in
PageRepository.php
fp-page.xsl - xslt for first page
site-page.xsl - xslt for any other page
include/ - php classes
output/ - here are stored generated pages
</pre>
</p>
<section id="making" name="How to make self pages" level="1"/>
<p>
To make self page, you must:
</p>
<p>
Create xml-content for page. F.e. I want to add page 'Poems':
<ol>
<li>
add to file pages.xml (in dir 'db-xml') -
<code><page id="poems" name="Poems" descr="My Poems"/></code>
inside tag <code><pages></code> (in this case page will be on top)
or inside any <code><page></code>.
</li>
<li>
create <code>poems.xml</code> in dir <code>/content/pages/</code>.
f.e.
<source><![CDATA[
<?xml vesrion="1.0"?>
<page-content>
<p>This is my poem</p>
</page-content>
]]></source>
</li>
<li>it all. Run <code>generateSite.php</code></li>
<li>Next step if you want to add specific tags, f.e.
<code><myTagInPoemPage/></code>:
<source><![CDATA[
<?xml vesrion="1.0"?>
<page-content>
<p>This is my poem.
<myTagInPoemPage/>
</p>
</page-content>
]]></source>
in this case you must to write
xslt-transformation for this tag in file <code>site-page.xsl</code> (content/xslt)
f.e.
<source><![CDATA[
<xsl:template match="myTagInPoemPage" mode="content">
<xsl:text>to be or not to be</xsl:text>
</xsl:template>
]]></source>
</li>
<li>it all. Run <code>generateSite.php</code></li>
<li>Next step (or first) - changing desing - change <code>site-page.xsl</code> and <code>fp-page.xsl</code> files.</li>
<li>Next steps - you can add you specific pages classes as <code>PageFP</code>,
but this is other story <smile/>...
</li>
</ol>
</p>
</page-content> |