[PHP] Re: XSLTProcessor help
'Twas brillig, and Tom Sparks at 17/02/09 15:17 did gyre and gimble: I have stopped XSLT from rendering out all the text but I am no further a long getting XSL stylescript to work I have been reading w3schools (http://www.w3schools.com/xsl/default.asp ) and XML 1.1 bible 3rd edition ( http://www.amazon.com/XML-Bible-Elliotte-Rusty-Harold/dp/0764549863 ) I am at a lost still!! It looks more or less OK to me... Infact I tried it via the command line: My XML: ?xml version=1.0 ? vehiclemetatitleHellooo/title/meta/vehicle The XSL is yours from the previous post: $ xsltproc test.xsl test.xml html head meta http-equiv=Content-Type content=text/html; charset=UTF-8 titlevehicle: Hellooo/title /head bodypre vehicle: Hellooo/pre/body /html Works fine. Are you sure you are not doing something odd in the calling code? e.g. make sure you are calling transformToXML() properly. Perhaps slap all your files somewhere so we can download and test for you. Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: XSLTProcessor help
- Original Message From: Colin Guthrie gm...@colin.guthr.ie Sent: Wednesday, 18 February, 2009 3:40:41 AM 'Twas brillig, and Tom Sparks at 17/02/09 15:17 did gyre and gimble: I have stopped XSLT from rendering out all the text but I am no further a long getting XSL stylescript to work I have been reading w3schools (http://www.w3schools.com/xsl/default.asp ) and XML 1.1 bible 3rd edition ( http://www.amazon.com/XML-Bible-Elliotte-Rusty-Harold/dp/0764549863 ) I am at a lost still!! It looks more or less OK to me... Infact I tried it via the command line: My XML: ?xml version=1.0 ? vehiclemetatitleHellooo/title/meta/vehicle The XSL is yours from the previous post: $ xsltproc test.xsl test.xml html head meta http-equiv=Content-Type content=text/html; charset=UTF-8 titlevehicle: Hellooo/title /head bodypre vehicle: Hellooo/pre/body /html Works fine. Are you sure you are not doing something odd in the calling code? e.g. make sure you are calling transformToXML() properly. Perhaps slap all your files somewhere so we can download and test for you. I have no where to put it yet, it is also a semi-private i am using XAMPP for windows specs + Apache 2.2.11 + MySQL 5.1.30 (Community Server) + PHP 5.2.8 + PEAR (Support for PHP 4 has been discontinued) + PHP-Switch win32 1.0 (use php-switch.bat in the xampp main directory) + XAMPP Control Version 2.5 from www.nat32.com + XAMPP Security 1.0 + SQLite 2.8.15 + OpenSSL 0.9.8i + phpMyAdmin 3.1.1 + ADOdb 4.990 + Mercury Mail Transport System v4.52 + FileZilla FTP Server 0.9.29 + Webalizer 2.01-10 + Zend Optimizer 3.3.0 + eAccelerator 0.9.5.3 für PHP 5.2.8 (but not activated in the php.ini) I have also got domi.class.php (http://domi.sourceforge.net/ ) but is not needed with the comment sections I am calling code by vehicle.php?id=1 there is a 1.xml in ./../vehicles/ from where the php file is the code is bellow -cut here ?php include('domi.class.php'); $id = $_GET['id']; $DOMi = new DOMi('./../vehicles/'.$id.'.xml'); $DOMi-Render('./../xsl/vehicle.xsl'); // $xslDoc = new DOMDocument(); // $xslDoc-load(./../xsl/vehicle.xsl); // $xmlDoc = new DOMDocument(); // $xmlDoc-load(./../vehicles/.$id..xml); // $proc = new XSLTProcessor(); // $proc-importStylesheet($xslDoc); // echo $proc-transformToXML($xmlDoc); ? cut here tom_a_sparks Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: XSLTProcessor help
'Twas brillig, and Tom Sparks at 16/02/09 10:49 did gyre and gimble: help, when I include xsl:apply-templates/ the XSLTProcessor only strips the XML tags and outputs the text see result --cut here vehicle.xsl- ?xml version=1.0 ? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xsl:template match=/ html head XSL needs to know that you are outputting XML-derived data... eg. try putting this before your xsl:template: xsl:output method=html indent=no encoding=UTF-8 omit-xml-declaration=yes/ Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: XSLTProcessor help
same result cut here--- htmlheadmeta http-equiv=Content-Type content=text/html; charset=UTF-8/headbodypre Hyalearl, 100-ton Sulieman-Class Scout/Courier 2008 03 10 All rights reserved 2008 Onno Meyer n...@none.com 10 Traveller 1.0 /pre/body/html -cut here--- -cut here--- ?xml version=1.0 ? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;; xsl:output method=html indent=no encoding=UTF-8 omit-xml-declaration=yes/ xsl:template match=/ html head /head body pre xsl:apply-templates/ /pre /body /html /xsl:template xsl:template match=meta !-- head -- /xsl:template /xsl:stylesheet -cut here--- tom_a_sparks Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html - Original Message From: Colin Guthrie gm...@colin.guthr.ie To: php-general@lists.php.net Sent: Monday, 16 February, 2009 9:41:46 PM Subject: [PHP] Re: XSLTProcessor help 'Twas brillig, and Tom Sparks at 16/02/09 10:49 did gyre and gimble: help, when I include xsl:apply-templates/ the XSLTProcessor only strips the XML tags and outputs the text see result --cut here vehicle.xsl- ?xml version=1.0 ? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;; xsl:template match=/ html head XSL needs to know that you are outputting XML-derived data... eg. try putting this before your xsl:template: xsl:output method=html indent=no encoding=UTF-8 omit-xml-declaration=yes/ Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php