@ 2015-04-29T10:32:33Z <?php
$str=<<<XML
<control>
<prop name='prop_id' value='panel_right_5'/>
<prop name='prop_type' value='panel'/>
<prop name='width' value='192px'/>
<prop name='height' value='208px'/>
<prop name='float' value='left'/>
<prop name='margin-left' value='2px'/>
<prop name='margin-top' value='1px'/>
<controls>
<control>
<prop name='prop_id' value='0'/>
<prop name='prop_type' value='button'/>
<prop name='prop_style_class' value='estilo_panel_5'/>
<prop name='prop_action' value='1'/>
<prop name='prop_action_value' value='0'/>
<prop name='prop_text1' value='0'/>
<prop name='prop_text1_valign' value='middle'/>
<prop name='prop_text1_halign' value='center'/>
<prop name='width' value='62px'/>
<prop name='height' value='50px'/>
</control>
<control>
<prop name='prop_id' value='00'/>
<prop name='prop_type' value='button'/>
<prop name='prop_style_class' value='estilo_panel_5'/>
<prop name='prop_action' value='46'/>
<prop name='prop_action_value' value='00'/>
<prop name='prop_text1' value='00'/>
<prop name='prop_text1_valign' value='middle'/>
<prop name='prop_text1_halign' value='center'/>
<prop name='width' value='62px'/>
<prop name='height' value='50px'/>
</control>
<control>
<prop name='prop_id' value=','/>
<prop name='prop_type' value='button'/>
<prop name='prop_style_class' value='estilo_panel_5'/>
<prop name='prop_action' value='1'/>
<prop name='prop_action_value' value=','/>
<prop name='prop_text1' value=','/>
<prop name='prop_text1_valign' value='middle'/>
<prop name='prop_text1_halign' value='center'/>
<prop name='width' value='62px'/>
<prop name='height' value='50px'/>
</control>
</controls>
</control>
XML;
$xml=simplexml_load_string($str);
$result=$xml->xpath("//prop[@name='prop_action'][@value='46']");
echo $result->asXML()."\n\n";
foreach($result as $control)
{
echo $control->asXML()."\n\n";
}
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.0.0 - 7.0.20 , 7.1.0 - 7.1.20 , 7.2.0 - 7.2.33 , 7.3.16 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.6 Fatal error: Uncaught Error: Call to a member function asXML() on array in /in/pVuaq:54
Stack trace:
#0 {main}
thrown in /in/pVuaq on line 54
Process exited with code 255 . Output for 5.6.8 - 5.6.28 Fatal error: Call to a member function asXML() on array in /in/pVuaq on line 54
Process exited with code 255 . Output for 5.0.0 - 5.0.5 , 5.1.0 - 5.1.1 , 5.1.3 - 5.1.6 , 5.2.0 - 5.2.17 , 5.3.0 - 5.3.29 , 5.4.0 - 5.4.45 , 5.5.24 - 5.5.35 Fatal error: Call to a member function asXML() on a non-object in /in/pVuaq on line 54
Process exited with code 255 . Output for 5.1.2 Fatal error: Call to a member function asXML() on a non-object in /in/pVuaq on line 55
Process exited with code 255 . Output for 4.4.5 - 4.4.9 Fatal error: Call to undefined function: simplexml_load_string() in /in/pVuaq on line 52
Process exited with code 255 . Output for 4.3.2 - 4.3.11 , 4.4.0 - 4.4.1 , 4.4.3 - 4.4.4 Fatal error: Call to undefined function: simplexml_load_string() in /in/pVuaq on line 52
Process exited with code 255 . Output for 4.4.2 Fatal error: Call to undefined function: simplexml_load_string() in /in/pVuaq on line 53
Process exited with code 255 . Output for 4.3.0 - 4.3.1 Fatal error: Call to undefined function: simplexml_load_string() in /in/pVuaq on line 52
preferences:dark mode live preview
210.72 ms | 401 KiB | 312 Q