The_Holy_One Posted November 20, 2006 Share Posted November 20, 2006 i have a cdsammlung.xml file with a lot of CD Title's and Autor's, a self coded *.xsl file which works as an stylesheet on the xml and the PHP script which creates the *.rt RealText file but the problem is: Every time i create the File the first sentence is the XML Standard 1.0 Header, BUT RealText doesnt support it so i cant use the file until i delete the first sentence manually, has anybody an idea how to cut of the xml header or known a better function as save()?Here the PHP Code:[code=php:0] $dom = new DomDocument(); $dom->load("cdsammlung.xml"); $xsl = new DomDocument(); $xsl->load("titel.xsl"); //titel.rt $xpr = new XsltProcessor(); //$xpr->registerPHPFunctions(); $xsl = $xpr->importStylesheet($xsl); $output = $xpr->transformToDoc($dom); $output->save(titel.rt); [/code]Here the Plaintext of the RealText file:[CODE]<?xml version="1.0" encoding="iso-8859-1"?><window type="generic" height="100" width="800" bgcolor="black" duration="594"><font size="6" color="red"/><clear/><time begin="0... AND so one...[/CODE]All would be working fine WITHOUT the Sentence "<?xml version="1.0" encoding="iso-8859-1"?>" any Ideas ? Link to comment https://forums.phpfreaks.com/topic/27873-cut-of-xml-header/ Share on other sites More sharing options...
The_Holy_One Posted November 20, 2006 Author Share Posted November 20, 2006 I found a Solution myself:You have to edit your output method in your xsl file from "xml" to "text"--> <xsl:output method="text" encoding="iso-8859-1"/>And you must modify your save Function into--> $output->saveHTMLFile();Thats all ;) lol ^^ Link to comment https://forums.phpfreaks.com/topic/27873-cut-of-xml-header/#findComment-127496 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.