XPath expression to validate attribute values โโfor multiple child nodes
Given the XML below, I am looking for an XPath query to answer the following question:
Does the list of languages โโabove contain all of these languages: "English", "French" and "Norwegian"?
In other words, is there a way to find out if the "Objects" node contains a given set of languages? The answer is TRUE for "English", "French" and "Norwegian", but FALSE for "Arabic", "English", "French" and "Norwegian".
<Document>
<Entities>
<Entity Name="Afrikaans" Id="2000" Type="Language"/>
<Entity Name="Dansk" Id="2002" Type="Language"/>
<Entity Name="Deutsch" Id="2003" Type="Language"/>
<Entity Name="English" Id="2005" Type="Language"/>
<Entity Name="Espaรฑol" Id="2006" Type="Language"/>
<Entity Name="French" Id="2007" Type="Language"/>
<Entity Name="Indonesian" Id="2010" Type="Language"/>
<Entity Name="Italiano" Id="2012" Type="Language"/>
<Entity Name="Norwegian" Id="2018" Type="Language"/>
</Entities>
</Document>
+3
source to share
3 answers