mathewrond Posted August 30, 2006 Share Posted August 30, 2006 Hi,I am trying to query XML file for some information. For some reason I dont get it correct. This is my queryString. I am tring to query based on the element attribute. <queryString language="xPath"><![CDATA[/Root/Manager/item[/Root/Manager/@name =SD]]]></queryString> I am getting the manager name as null <field name="Manager" class="java.lang.String"> <fieldDescription><![CDATA[@name]]></fieldDescription></field> This is my XML structure < Root >< Manager name='SD' > < Item > < ID > 996104 < /ID > < AccName > ABC Co < /AccName > < Count > 10 < /Count > < CID > 7849 < /CID > < / Item > < Item > < ID > 996105 < /ID > < AccName > NYZ Co < /AccName > < Count > 14 < /Count > < CID > 7850 < /CID > < / Item > < / Manager > < Manager name="UP" > < item > < ID > 046507 < /ID > < AccName > XYZ Co < /AccName > < Count > 0 < /Count > < CID > 8241 < /CID > < /item >< /Manager > < /Root > Can some one correct me with the query please? Thanks Link to comment Share on other sites More sharing options...
mathewrond Posted August 30, 2006 Author Share Posted August 30, 2006 I figured out myself. Incase any one wants in future, you can use this queryString <queryString language="xPath"><![CDATA[/Root/Manager/item[ancestor::Manager/@name =UD]]]></queryString> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now