I am trying to build a complex xpath expression which will answer the following condition.
From the XML data below, returns the User entity which:
- His loginname is "user1"
- His name is "User 1"
He has 2 different profiles values which are "operator" and "admin" (I don't know the exact order ahead)
<user> <login>user1</login> <name>User 1</name> <profile> <value>admin</value> <id>2</id> <description>admin users</description> </profile> <profile> <value>operator</value> <id>1</id> <description>Operator</description> </profile> </user> <user> <login>user2</login> <name>User 2</name> <profile> <value>admin</value> <id>4</id> <description>admins users</description> </profile> <profile> <value>poweruser</value> <id>5</id> <description>power users</description> </profile> </user> </root>
Can someone please supply an example for such a case?
EDIT: Added a complex profile entity
See Question&Answers more detail:os