kimtd Posted March 19, 2008 Share Posted March 19, 2008 Hi everyone. I'm in the process of writing a script to convert HTML to XML. I read somewhere that TIDY is a good way of doing it... so I 1) convert HTML like this to XHTML like this using TIDY 2) then I convet to XML using simple_xml_load() function in PHP This works well.. except "href" attribute in "<a href>" gets lost and all the relevant link information is gone. Basic PHP script: var_dump(simplexml_load_file($filename)); Can anyone help with this? Link to comment https://forums.phpfreaks.com/topic/96955-convert-xhtml-to-xml/ Share on other sites More sharing options...
Barand Posted March 19, 2008 Share Posted March 19, 2008 What version of PHP? I believe there is a bug with atttributes in 5.1 that was fixed in 5.2 (plus some other extras) Link to comment https://forums.phpfreaks.com/topic/96955-convert-xhtml-to-xml/#findComment-496284 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.