I just started learing XML and was wondering if there is any way to extract information about XML attributes using PHP.
for example, say i have Contact.xml and i want to only display those contacts where id="1".
[php]
// Contact.xml
<?xml version="1.0"?>
<contact>
<type id="1">
<name></name>
<email></email>
</type>
<type id="2">
<name></name>
<email></email>
</type>
</contact>
[/php]
i then use a switch statement within the PHP script to convert the XML tags to HTML, but this parses the entire document.
is there a way within the PHP script to only parse a selection of the XML document that meets a certain criteria (i.e. id="1")???
thanks in advance...