PDA

View Full Version : Xpath expression help - urgent pls!!


jagan_wp
01-30-2004, 12:07 AM
I am trying to parse the DOM document that i could successfully generate out of this file, using XPath.
I am only interested in the attributes and their values. Using the code that i wrote, i am able to get only the attributes but not their values. Can someone please modify the XPath expression that i need to use, to get the values also?
The xpression tht i am using is:
String xpathAttr = "//*[starts-with(name(), 'at')]";
What do i need to add to this, if i need to get its corresponding value childnodes too ?
Thanks!

The source XML file is given below:
---------
-------
........
........
<Profile>
<attribute name="%USER_ID%" >
<value>
wptest1
</value>
</attribute>
<attribute name="%ORG_MEMBERSHIP%" >
<value>
OU=webUsers,OU=usersAndGroups,DC=company,DC=com
</value>
<attribute name="%FIRST_NAME%" >
<value>
wptest1
</value>
<attribute name="%MEMBER_OF%" >
<values>
<value>
CN=group1,OU=Groups,OU=usersAndGroups,DC=company,DC=com
</value>
<value>
CN=group2,OU=Groups,OU=usersAndGroups,DC=company,DC=com
</value>
</values>
</attribute>
</Profile>
.......
.......
------