note 108809 added to domelement.getattributenode
| From: | Colepicolo | Date: | Fri, 25 May 2012 23:44:11 +0000 |
| Subject: | note 108809 added to domelement.getattributenode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188242@lists.php.net to get a copy of this message | ||
XML Document:
<mods>
<...>
<namePart type="family">Abikoff</namePart>
<namePart type="given">Howard B.</namePart>
<...>
</mods>
---
PHP file:
$doc = new DOMDocument(); // initialize the class
$doc->load( 'example.xml' ); // load the xml document
foreach($mods as $mod) { // main tag
$namesPart = $doc->getElementsByTagName( "namePart" );
foreach( $namesPart as $namePart )
{
$namePart = $mod->getElementsByTagName( "namePart" );
$attr = $namePart->item(0)->getAttributeNode("type");
echo $output = $namePart->item(0)->nodeValue . "<br>";
}
}
----
Server IP: 69.147.83.197
Probable Submitter: 177.34.172.210
----
Manual Page -- http://www.php.net/manual/en/domelement.getattributenode.php
Edit -- https://master.php.net/note/edit/108809
Del: integrated -- https://master.php.net/note/delete/108809/integrated
Del: useless -- https://master.php.net/note/delete/108809/useless
Del: bad code -- https://master.php.net/note/delete/108809/bad+code
Del: spam -- https://master.php.net/note/delete/108809/spam
Del: non-english -- https://master.php.net/note/delete/108809/non-english
Del: in docs -- https://master.php.net/note/delete/108809/in+docs
Del: other reasons-- https://master.php.net/note/delete/108809
Reject -- https://master.php.net/note/reject/108809
Search -- https://master.php.net/manage/user-notes.php