412 CHAPTER 13 CASE STUDY: USING PHP (Jetty web server)
412 CHAPTER 13 CASE STUDY: USING PHP FOR AN XML APPLICATION The application also adds the outlook to the document. Because the code sorts the query in reverse count order, it displays the first record, which contains the highest number of responses: $outlook = $xml->createElement(’outlook’, $wrow[’weatherType’]); $outlook = $root->appendChild($outlook); As the page finishes with the weather report, it can output the available weather types. You ve seen this code before: $types = $xml->createElement(’weathertypes’); $types = $root->appendChild($types); $sql = ‘SELECT weatherTypeID, weatherType FROM weatherType’; $tRes = mysql_query($sql) or die(mysql_error() . “n 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.
” . $sql); while ($tRow = mysql_fetch_array($tRes)) { $type = $xml->createElement(’type’, $tRow[’weatherType’]); $type->setAttribute(’id’, $tRow[’weatherTypeID’]); $type = $types->appendChild($type); } } weather.xsl The application needs to transform the XML content using the XSLT stylesheet weather.xsl. The stylesheet starts in the following way:
Error
Weather for