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!! Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
dragunov Posted August 13, 2010 Author Share Posted August 13, 2010 Hey Thanks br0.. 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.