Forum Discussion

teemu_selkala's avatar
teemu_selkala
Occasional Contributor
13 years ago

Unable to get selectNode to work =/

Hi,



I have rather large xml file with schema included. I would like to use selectNode to reduce the amount of choises instead of going through each node in the xml file.



in my XML file I have a node group as follows:



<rs:data>

     <this and that>

</rs:data>



but when I try to use selectNode as follows...



nodes = Doc.SelectNode("//rs:data")



I get an object calling error always. I tried to follow example from:

http://support.smartbear.com/viewarticle/32705/



Error is



"msxml6.dll



reference to undecleared namespace prefix: 'rs'



any ideas how to fix that?



Cheers

  • teemu_selkala's avatar
    teemu_selkala
    Occasional Contributor
    <xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'

     xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'

     xmlns:rs='urn:schemas-microsoft-com:rowset'

     xmlns:z='#RowsetSchema'>



    forgot to add this from beginning of xml
  • teemu_selkala's avatar
    teemu_selkala
    Occasional Contributor
    I added following and now it returns a node:




    Doc.setProperty("SelectionNamespaces","xmlns:rs='urn:schemas-microsoft-com:rowset'")




    But do I always have to do this manually? Add selectionnamespaces from actual xml before I can use selectNodes?