Web site management - CHAPTER 13 CASE STUDY: USING PHP FOR

CHAPTER 13 CASE STUDY: USING PHP FOR AN XML APPLICATION 403 $entry = $xml->createElement(’entry’, $crow[’continent’]); $entry->setAttribute(’id’, $crow[’continentID’]); $items->appendChild($entry); } } By the time the script finishes running, it has built an XML document that is transformed in the standard.php script, as you saw earlier. nav.xsl Let s look at the XSLT stylesheet, nav.xsl in more detail. This stylesheet transforms the XML document from the mk_navxml.php page. The stylesheet starts with an XML declaration and the opening element: The code creates some XSLT variables to store values that the stylesheet will use: It uses the linksto variable to determine the link type, and the numLinks variable to determine whether any links exist. The page uses the element to provide some conditional logic. To start with, it identifies errors:

Error

When the application has an error, the stylesheet displays it in a level 4 heading. If there is no error, it displays the requested details:

Current:

The stylesheet uses another element to see if there are any subnavigation links:
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

Leave a Reply