0

I am using SimpleXML to read a xml document, and I need to know if it is possible to read node between comments like this:

<!-- start block -->
<!-- screenname:Athan Screen,screenpath:athan_screen.png --> 

    <string name="adhan_labelChoosed">Athan</string>
    <string name="adhan_labelAlert">Reminders</string>
    <string name="adhan_click">Click Here</string>

<!-- end block -->

I want to get start of block and all nodes inside it. also need to get screen name and path.

user1931943
  • 77
  • 1
  • 10
  • @Ohgodwhy The comments shown *are* valid XML. They just happen to have a non-element node type. This may be a *limitation* of SimpleXML, but it is not a limitation of XML. – user2864740 May 11 '15 at 19:25
  • @MarcB this is just reading comments. I need read nodes between comments – user1931943 May 11 '15 at 19:25
  • 1
    dom's a tree. once you find a node, you can navigate around the branches of the tree to find sibling/ancestor/descendant nodes. so... find your comment nodes, then start climbing around. – Marc B May 11 '15 at 19:29
  • Marc b can you give example how? – user1931943 May 11 '15 at 19:32
  • FYI: The reference question for parsing XML with PHP is: [How do you parse and process HTML/XML in PHP?](http://stackoverflow.com/q/3577641/367456) - Please also search for other resources we have on site already, there are some that explain the part with the tree very well. Certainly most are linked to that reference question or already part of it. – hakre May 11 '15 at 21:12

0 Answers0