>I am trying to use selectnodes on parentNode of the context Node and it is
>not returning the correct resull. Heres my XML
[quoted text clipped - 18 lines]
>
>What is it that I am missing ? Any help would be appreciated.
It is returning the correct result. Perhaps you should tell us which
node(s) you wanted it to return.
Regards,
Steve
--
Please post questions to the newsgroup; everyone benefits.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sample code subject to http://www.microsoft.com/info/cpyright.htm
Rama - 07 Mar 2005 15:19 GMT
Steve,
Since my context node is <field name='test1' > , I am trying to go one
step back to the parent node; the xml corresponding to the parent nopde
should be as follows :
<fields>
<field name='test1' > // my context node
<field name= 'test11'>
<field name ='test1'2 >
</fields>
My objective is to find out if attribute 'name' for nodes 'field' is
unique within its parent node 'fields'. My Xml DOM also contain 'field' node
at some other levels and it is somehow returning every node named field
within the document.
I hope, i have made my problem clear, let me know if i further need to
clarify anything.
Thanks,
Rama
> >I am trying to use selectnodes on parentNode of the context Node and it is
> >not returning the correct resull. Heres my XML
[quoted text clipped - 28 lines]
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Sample code subject to http://www.microsoft.com/info/cpyright.htm
Because you are using a relative search query that finds any node named
"fields" with the XPPATH query "//fields/field[@name='test1']"
To get the parent node, you'll need to use the absolute path which starts
with the root node. In your case, you'll want to use "/a/fields/field
[@name='test1']".
You may also want to look at the function selectSingleNode().