Creating A Php File For The Book

THL Toolbox > Developers' Zone > Web Development > XML Books > Creating a PHP File for the Book

Creating a PHP File for the Book

Contributor(s); Than Grove, Steven Weinberger

Based on example at: • external link: http://dev.thlib.org/places/monasteries/publications/bon-book.php Location of the XML file is: • {svn-repo}textsbooksxmlbonpo-monasteriesmain.xml

To create a new book, do the following:

  1. When XML file is converted, open in Oxygen and clean up.
  2. Once it validates, open in Oxygen the XSL file from the cocoon subversion site in textsessaysxslinternal-useassignDivIds.xsl.
  3. With the XML file the active doc, set up a transformation, press the wrench next to the play button, the red arrow.
  4. Make a new transformation, by pressing the new button.
  5. with xml url as ${currentFileURL} and the xsl url assignDivIds.xsl.
  6. with xml url as ${currentFileURL} and the xsl url assignDivIds.xsl.
  7. Set xml url as ${currentFileURL} and the xsl url assignDivIds.xsl.
  8. For output choose, save as. Click ok.
  9. Click OK. Then "Transform now".
  10. The resulting file will have IDs assigned in it. Save it under a new name or as main.xml, which will be it's final name.
  11. Save that file in a new folder textsbooksxml. The name of the folder is what distinguishes the book and will be part of the url. Make it descriptive but as short as possible. Save the file in that folder as "main.xml".
  12. Make a PHP file for the book in the appropriate place on the site. See Dev placesmonasteriespublicationsbon-book.php
  13. In that bon-book.php file, adjust the following variables to match the new book:
    1. var page_title = "Bonpo Monasteries";
    2. book_url = "/bonpo-monasteries/"; (note: this location should match the name of the folder in the cocoon books site /texts/books/xml/{folder})
    3. book_link_text = "Bonpo Monasteries";
    4. first_section = "b1";

Provided for unrestricted use by the external link: Tibetan and Himalayan Library