caedo Posted June 30, 2008 Share Posted June 30, 2008 Hi, I'm using DOMDocument for parsing an XML file. In some point of the algorithm I need to read all the attributes an specific node has and put them into an array. I want to make this function as generic as possible, so I can use it with any XML file. Is there a way to read the attributes not by the id? pd: I know the getAttribute() function works with the id but that doenst works with what I want to do. Thanks in advance Caedo. Link to comment https://forums.phpfreaks.com/topic/112619-solved-troubles-with-domdocument/ Share on other sites More sharing options...
rhodesa Posted June 30, 2008 Share Posted June 30, 2008 Are you using PHP5+ ? If so, SimpleXML is usually much easier to work with. And here is what you are looking for in SimpleXML: http://us.php.net/manual/en/function.simplexml-element-attributes.php Link to comment https://forums.phpfreaks.com/topic/112619-solved-troubles-with-domdocument/#findComment-578434 Share on other sites More sharing options...
caedo Posted June 30, 2008 Author Share Posted June 30, 2008 I took your advice. Thanks Link to comment https://forums.phpfreaks.com/topic/112619-solved-troubles-with-domdocument/#findComment-578585 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.