dragunov Posted August 13, 2010 Share Posted August 13, 2010 Hi Guys I am parsing xml using. I need to know if I can associate character data with tags while parsing character data. For example I have the following xml:-- <tag1>tag1 character data</tag1> <tag2>tag2 character data</tag2> Now, is there a way I can associate "tag1 character data" with <tag1> and "tag2 character data" with <tag2> while parsing php. Thanks in advance!! Link to comment https://forums.phpfreaks.com/topic/210617-associating-tags-with-character-data-in-xml-using-php/ Share on other sites More sharing options...
helloworld2010 Posted August 13, 2010 Share Posted August 13, 2010 Of course you can, I know 2 ways. First: there is a function called xpath in SimpleXML library can do that; Second: use QueryPath library, and you'll find it very easy. Link to comment https://forums.phpfreaks.com/topic/210617-associating-tags-with-character-data-in-xml-using-php/#findComment-1098775 Share on other sites More sharing options...
dragunov Posted August 13, 2010 Author Share Posted August 13, 2010 Hey Thanks br0.. Link to comment https://forums.phpfreaks.com/topic/210617-associating-tags-with-character-data-in-xml-using-php/#findComment-1098807 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.