I want to parse this and need to know the number of children has. I am told that comments should also count as children. I am confused as to count all tags inside the parent as children?
<div class="event">
<h4>Northland Outdoors Duluth Deer Classic</h4>
<span class="timestamp" style="display: none;">1424282400</span>
<p class="date"><span class="month">February</span> 18, <span class="year">2015</span> </p> <table><tr><td class="field-name">Location:</td>
<td class="location">
<span class="city">Duluth</span>,
<span class="state">MN</span>, Duluth Entertainment Convention Center</td><td><tr><td class="field-name">Description:</td><td>Join us at the Northland Outdoors Duluth Deer Classic February 18th - 20th, 2015, which will again be held in conjunction...
<a href="/events/details/northland-outdoors-duluth-deer-classic2" title="View listing detail">View more detail »</a></td></tr><tr><td class="field-name">Types of Vendor:</td><td>
<ul class="vendors"><li class="allowed art">Art</li><li class="allowed craft">Craft</li><li class="allowed commercial">Commercial</li></ul> </td></tr></table><div class="clear"></div></div>
once you parse the event class by DOM/Curl its convert the String to the nodes objects. the Objects are called to all the breaking points ie. or . the each node can also contain other childs such as
<div class= 'event'> <p class='class2'>something here</p></div>
In this format the class2 is a subclass or a child of the class event.The best way of parsing the html is look (search) by class name or href ... and don't use direct path to the target section. It is more safe and efficient in parsing. On the other hand the best way to identify the child are just counting the direct/major opening and closing section < ></>