jd2007 Posted December 17, 2007 Share Posted December 17, 2007 php code : <?php $doc = new DomDocument; // We need to validate our document before refering to the id $doc->validateOnParse = true; $doc->Load('xml.php'); echo $doc->getElementById('477b0f0cdd410')->tagName . "\n"; ?> this is xml.php: <?xml version="1.0" encoding="windows-1250"?> <sos><cat id3="477b0f0cdd410"/></sos> Quote Link to comment Share on other sites More sharing options...
trq Posted December 17, 2007 Share Posted December 17, 2007 Shouldn't it be <cat id= and not <cat id3= ? Quote Link to comment Share on other sites More sharing options...
jd2007 Posted December 17, 2007 Author Share Posted December 17, 2007 when i set it i gave it the name 'id3' and set id3's type to ID.... Quote Link to comment Share on other sites More sharing options...
freebsdntu Posted December 17, 2007 Share Posted December 17, 2007 $doc->Load('xml.php'); I am not sure if you can load a .php file. Quote Link to comment Share on other sites More sharing options...
jd2007 Posted December 18, 2007 Author Share Posted December 18, 2007 oh...its actually .xml, I accidentally typed it wrong...i still have the problem.. Quote Link to comment Share on other sites More sharing options...
jd2007 Posted December 18, 2007 Author Share Posted December 18, 2007 never mind, i fixed it...anyway thanks for ur answers... Quote Link to comment Share on other sites More sharing options...
play_ Posted December 18, 2007 Share Posted December 18, 2007 What was the solution? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.