The following is part of a larger XML document.
<gmd:descriptiveKeywords>
<gmd:MD_Keywords>
<gmd:keyword>
<gco:CharacterString>Addresses</gco:CharacterString>
</gmd:keyword>
<gmd:keyword>
<gco:CharacterString>Administrative units</gco:CharacterString>
</gmd:keyword>
<gmd:keyword>
<gco:CharacterString>Atmospheric conditions</gco:CharacterString>
</gmd:keyword>
<gmd:thesaurusName>
<gmd:CI_Citation>
<gmd:title>
<gco:CharacterString>GEMET - INSPIRE themes, version 1.0</gco:CharacterString>
</gmd:title>
<gmd:date>
<gmd:CI_Date>
<gmd:date>
<gco:Date>2008-01-06</gco:Date>
</gmd:date>
<gmd:dateType>
<gmd:CI_DateTypeCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="revision">revision</gmd:CI_DateTypeCode>
</gmd:dateType>
</gmd:CI_Date>
</gmd:date>
</gmd:CI_Citation>
</gmd:thesaurusName>
</gmd:MD_Keywords>
</gmd:descriptiveKeywords>
<gmd:descriptiveKeywords>
<gmd:MD_Keywords>
<gmd:keyword>
<gco:CharacterString>'Other' wave statistics</gco:CharacterString>
</gmd:keyword>
<gmd:keyword>
<gco:CharacterString>Acoustic noise in the water column</gco:CharacterString>
</gmd:keyword>
<gmd:thesaurusName>
<gmd:CI_Citation>
<gmd:title>
<gco:CharacterString>SeaDataNet P021 parameter discovery vocabulary</gco:CharacterString>
</gmd:title>
<gmd:date>
<gmd:CI_Date>
<gmd:date>
<gco:Date>2009-11-16</gco:Date>
</gmd:date>
<gmd:dateType>
<gmd:CI_DateTypeCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="revision">revision</gmd:CI_DateTypeCode>
</gmd:dateType>
</gmd:CI_Date>
</gmd:date>
</gmd:CI_Citation>
</gmd:thesaurusName>
</gmd:MD_Keywords>
</gmd:descriptiveKeywords>
There are several
gmd:descriptiveKeywords
tags.
What I need to do is get the gmd:descriptiveKeywords tag that contains the following path
<gmd:thesaurusName>
<gmd:CI_Citation>
<gmd:title>
<gco:CharacterString>
The gco:CharacterString tag will contain the following
<gco:CharacterString>GEMET - INSPIRE themes, version 1.0</gco:CharacterString>
The closest I have come is using the following syntax
$inspire_keywords = $importxml->xpath('//gmddescriptiveKeywords[//gcoCharacterString[. = "GEMET - INSPIRE themes, version 1.0"]]');
But this just returns me all of the gmd:descriptiveKeywords not just the one I am targeting above.
Can anyone offer up the correct xpath syntax I should be using?
Thanks for any help.