[PHP] PHP: XML/XSL
Hi everybody, I'm using Sablotron to transform XML with XSL and this is the PHP file: ?PHP $strXhtml = ?xml version=\1.0\?\n; $strXhtml = $strXhtml . htmlbody\n; $strXhtml = $strXhtml . pbfont color=\#800080 \Balance:/font/b/p\n; $strXhtml = $strXhtml . p align=\left\input type=\text\ name=\balanceText\ size=\20\ value=\200$\//p\n; $strXhtml = $strXhtml ./body/html; //echo(trim($strXhtml)); include(XSLTransformer.php); $xml=$strXhtml; $xsl=testing.xsl; $transform = new XSLTransformer(); if($transform-setXsl($xsl)) { if($transform-setXmlString($xml)) { $transform-transform(); if ($transform-getError() == 0) { echo $transform-getOutput(); } else { echo pError transforming ,$xml,./p\n; } } else { echo p,$xml,: ,$transform-getError(),/p\n; } $transform-destroy(); } ? I'm getting the following warning although I'm sure that if I applied XSL to the XML file without php, it's working. Plz can u help me and tell me what could be the problem? Warning: xslt_process(): supplied argument is not a valid XSLT Processor resource in /home/alia/public_html/XHTML/XSLTransformer.php on line 69 Thx a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP xml: urgent!
Hello, I have an HTML file. I want to transform it to XML then filter it and transform it to another XML file. I used Sablotron with PHP to apply XSL to XML to filter the XML file. But I'm facing problems when I want to transform HTML to XML. I used TIDY but it seems it transforms to XHTML in a format not appropriate to Sablotron parser. I'm getting this msg: Warning: Sablotron error on line 26: cannot open file '/home/alia/public_html/XHTML/testing.xhtml' in /home/alia/public_html/XHTML/XSLTransformer.php on line 91 Can u plz help me. Thx a lot. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php and xml
Hello What's the best to convert HTML to XML that I can use in PHP Thx a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP: problem with patterns
Hi again, I hope u can help me with this. I have to parse an html file and replace src attribute of an img. I'm using 'preg_match_all' but it seems i'm having problem with patterns. This is the part of code that should find the appropriate img src: $preg='/img(.*?)src=[\'|]'.addcslashes($original,/).'[\'|](.*?)/si'; if (preg_match_all($preg,$arrFile,$match)) { echo $match[1][0]; } where $original contains the value of src that it should find. For expl, $original can be: ../../MyMCMSSite/images/pic1_abeoway.gif. But the problem is it's not catching the right img src. Hope u can help me. Thx a lot Alia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP: preview an html file.
Hello everybody, I hope u can help me with this. I'll be very grateful! This file retrieves a list of files from a folder on the server and then has to diplay a list of them. When selecting one of them in the list, it should display a preview (i.e. its contents) in the same file. I think i should use frames but donno how to do it :(. Thx a lot ?PHP $d = dir(/home/mcms/public_html/MCMS/Alia/pageTmp); ? html head /head body form method=POST action=showTree.php pbPlz select a page template:/b/p pselect size=1 name=pageList ?PHP while (false !== ($entry = $d-read())) { if ($entry != '.' $entry != '..') echo 'option value='.$entry.''.$entry.'/option.\n'; } ? /select/p pinput type=submit value=Create name=createButton input type=hidden value=/home/mcms/public_html/MCMS/Alia/pageTmp/ name=pageField //p ?PHP /*if (!$file = fopen(/home/mcms/public_html/MCMS/Alia/pageTmp/ $pageList, rb)){ echo(couldnt open the file.); } else{ fpassthru($file); }*/ ? /form /body /html ?PHP $d-close(); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error handling
Hi everybody, I hope u can help me with this. This file should give me an error msg that there is time-out coz of the loop. But it's not giving me anything. What could be the problem? Thx a lot ?php $str = (0,0); // redefine the user error constants - PHP 4 only define (FATAL,E_USER_ERROR); define (ERROR,E_USER_WARNING); define (WARNING,E_USER_NOTICE); // set the error reporting level for this script error_reporting (FATAL | ERROR | WARNING); // error handler function function myErrorHandler ($errno, $errstr, $errfile, $errline) { switch ($errno) { case FATAL: echo bFATAL/b [$errno] $errstrbr\n; echo Fatal error in line .$errline. of file .$errfile; echo , PHP .PHP_VERSION. (.PHP_OS.)br\n; echo Aborting...br\n; exit (1); break; case ERROR: echo bERROR/b [$errno] $errstrbr\n; break; case WARNING: echo bWARNING/b [$errno] $errstrbr\n; break; default: echo Unkown error type: [$errno] $errstrbr\n; break; } } // function to test the error handling function scale_by_log ($vect, $scale) { if ( !is_numeric($scale) || $scale = 0 ) trigger_error(log(x) for x = 0 is undefined, you used: scale = $scale, FATAL); if (!is_array($vect)) { trigger_error(Incorrect input vector, array of values expected, ERROR); return null; } for ($i=0; $icount($vect); $i++) { if (!is_numeric($vect[$i])) trigger_error(Value at position $i is not a number, using 0 (zero), WARNING); $temp[$i] = log($scale) * $vect[$i]; } return $temp; } // set to the user defined error handler $old_error_handler = set_error_handler(myErrorHandler); for ($i=0;$i100;$i++) for ($j=0;$j100;$j++) $str .= ($i,$j); echo $str; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and HTML
Hi everybody Plz can u help me with this? I have an html file that diplays images. And I want to use PHP to parse this file: i.e. to display those images and their sources. How can this be done? Thx a lot Alia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Date function
Hello I have the following SQL and I wanna insert the current date in one of the table fields but it's not working. Can u tell me whats the problem? (I'm using mysql and php) Thx a lot $SQL = INSERT INTO orders (Customer_Id, Order_Date). VALUES($CustID,date()); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Forms in PHP
Hello I hope u can help me with this problem. I dont know if it is possible to do it. I'm using PHP and XML to generate the folowing HTML: ... form method=post action=cart.php input type=hidden name=itemid value=11/input ... input type=hidden name=itemid value=22/input ... input type=hidden name=itemid value=33/input ... ... I want to use PHP to count the number of $itemid in this file. Is it possible? And how? Thx a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and XML-QL/XQuery
Hi I'm searching for an XML-QL/XQuery engine or module for PHP. Does anyone have any idea where I can find it? Thx a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] functions
hi i would like now how can we call a function within another function in php? thx a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php