im kinda new to php and new to xslt. im looking at these classes http://phpxmlclasses.sourceforge.net/
and wanted to use the class_xslt. The example shown, works fine for me, but i want to use it getting the xml as a string.
in order that i can generate the xml from my db... i have used the xml to vreate a string but i get this error...
*Warning*: Sablotron error on line 16: XML parser error 7: mismatched tag
has anyone any experience using this class with a string? my sample is posted below...
thanks eoghan
======================================================================================= <? include_once("class_xslt.php");
$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n"; $xml .= "\t<apps>\r\n"; $xml .= "\t\t<application id=\"1\">\r\n"; $xml .= "\t\t\t<name>Editor</name>\r\n"; $xml .= "\t\t\t<author>John</author>\r\n"; $xml .= "\t\t\t<bugs>\r\n"; $xml .= "\t\t\t\t<bug>\r\n"; $xml .= "\t\t\t\t\t<desc>Foo</desc>\r\n"; $xml .= "\t\t\t\t\t\t<sev>2</sev>\r\n"; $xml .= "\t\t\t\t</bug>\r\n"; $xml .= "\t\t\t\t<bug>\r\n"; $xml .= "\t\t\t\t\t<desc>Bar</desc>\r\n"; $xml .= "\t\t\t\t\t\t<sev>3</sev>\r\n"; $xml .= "\t\t\t\t</bug>\r\n"; $xml .= "\t\t\t</bugs>\r\n"; $xml .= "\t</apps>\r\n";
//echo $xml;
$xslt=new Xslt(); $xslt->setXmlString($xml); $xslt->setXsl("tr1.xsl"); if($xslt->transform()) { $ret=$xslt->getOutput(); echo $ret; } else { print("Error:".$xslt->getError()); }
?>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php