Example:
Code: Select all
<?xml version="1.0" encoding="ISO88591" ?>
<calendar ver="2.0">
<yar yeartag="2009">
<mn m="1">
<dy d="1">
<shorttext>Day 1 Short</shorttext>
<link>Day 1 LINK</link>
<longtext>Day 1 Long</longtext>
</dy>
<dy d="2">
<shorttext />
<link />
<longtext />
</dy>
<dy d="3">
<shorttext />
<link />
<longtext />
</dy>
<dy d="4">
<shorttext />
<link />
<longtext />
</dy>
</mn>
<mn m="2">
<dy d="1">
<shorttext />
<link />
<longtext />
</dy>
<dy d="2">
<shorttext />
<link />
<longtext />
</dy>
<dy d="3">
<shorttext>Month 2 day 3 short</shorttext>
<link>LINK LINK</link>
<longtext>Long text for day 2/3</longtext>
</dy>
<dy d="4">
<shorttext />
<link />
<longtext />
</dy>
</mn>
<mn m="3">
<dy d="1">
<shorttext />
<link />
<longtext />
</dy>
<dy d="2">
<shorttext />
<link />
<longtext />
</dy>
<dy d="3">
<shorttext>Month 3 day 3 short</shorttext>
<link>LINK LINK</link>
<longtext>Long text for day 3/3</longtext>
</dy>
<dy d="4">
<shorttext />
<link />
<longtext />
</dy>
</mn>
</yar>
</calendar>I know I can loop through all the months and use an if ( $xml->yar->mn->attributes()->m == 1 ) then loop through each day and output whatever I want.
I don't want to loop through.
I want to just pick out all the days that are under the mn with the attribute of 1.
$days = $xml->yar->mn( WHERE THE ATTRIBUTE m == 1)->dy would be great.
Is this possible?
Thanks.