Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
hi all,
I guess my problem is really stupid, but I just can't figure it out.
I have to extract information from a DOM representation. My XML content is:
[syntax="xml"]
<record>
<header>
<identifier>oai:ub.rug.nl:dbi/4357aa6e091c0</identifier>
</header>
<metadata>
<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<dc:title>Just take her seriously</dc:title>
<dc:creator>Weijmar Schultz, W.C.M.</dc:creator>
</oai_dc:dc>
</metadata>
</record>
Code: Select all
$records = $dom->documentElement->getElementsByTagName('metadata');
foreach($records as $record) {
$children = $record->childNodes;
foreach($children as $child) {
echo $child->nodeName;
}
}However, when I try the same thing for the <dc:creator> tag, the otput is EMPTY.....
The following code:
Code: Select all
$records = $dom->documentElement->getElementsByTagName('dc:creator');
foreach($records as $record) {
echo $record->nodeName;
}I'm totally confused why it doesn't return any information about the <dc:creator> tag.
Thanks in advance Smiley
Pesho
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]