xmlSiteMaker
About | How it works | Examples | Download | Author

About
 

This application for offline generation. From xml documents by xslt transformation.

How to run
Directory structure
How to make self pages

How to run

To generate run script generateSite.php in directory bin. Output are stored in directory output.

You can use php4.0 xslt function or php4.3 xslt function only copy file XSLT.php.40 or XSLT.php.43 to XSLT.php file.

Directory structure

Dir structure:

  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 :)
      ...
    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

How to make self pages

To make self page, you must:

Create xml-content for page. F.e. I want to add page 'Poems':

  1. add to file pages.xml (in dir 'db-xml') - <page id="poems" name="Poems" descr="My Poems"/> inside tag <pages> (in this case page will be on top) or inside any <page>.
  2. create poems.xml in dir /content/pages/. f.e.
    <?xml vesrion="1.0"?>
    <page-content>
    <p>This is my poem</p>
    </page-content>
    
  3. it all. Run generateSite.php
  4. Next step if you want to add specific tags, f.e. <myTagInPoemPage/>:
    <?xml vesrion="1.0"?>
    <page-content>
    <p>This is my poem.
    <myTagInPoemPage/>
    </p>
    </page-content>
    
    in this case you must to write xslt-transformation for this tag in file site-page.xsl (content/xslt) f.e.
    <xsl:template match="myTagInPoemPage" mode="content">
    <xsl:text>to be or not to be</xsl:text>
    </xsl:template>
    
  5. it all. Run generateSite.php
  6. Next step (or first) - changing desing - change site-page.xsl and fp-page.xsl files.
  7. Next steps - you can add you specific pages classes as PageFP, but this is other story :)...

 

2005, xmlSiteMaker, nemilya at mail.ru on top page | How it works >>