Link to home
Start Free TrialLog in
Avatar of colly92002
colly92002Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Access elements of a node with namespace prefixs using MSXML (#C)

I am iterating through a nodelist returned from an XMLHTTP query, using MSXML 6.0 (not the .net natve XML).

Each node in the list looks like the attached code.

Is it possible to use xpath to return the data for each node?

For example, how do I get the friendly version ID?

I tried:
MSXML2.IXMLDOMNodeList versionNode = objNode.selectNodes("a:propstat/a:prop/e:FriendlyVersionID");

But this returns:
Reference to undeclared namespace prefix: 'a'.

How can I get around this in MSXML?  I can post more code if required.


<a:response xmlns:a="DAV:">
  <a:href>http://NHC-SP1/MedicalRecords/Documents/Medical%20Records/Patient%20Records/2001/Person%20-%20Care%20Plan%20-%20Standard%20-%2022-07-2008.doc</a:href> 
  <a:propstat>
    <a:status>HTTP/1.1 200 OK</a:status> 
    <a:prop>
      <a:href>http://NHC-SP1/MedicalRecords/Documents/Medical%20Records/Patient%20Records/2001/Person%20-%20Care%20Plan%20-%20Standard%20-%2022-07-2008.doc</a:href> 
      <a:displayname>Person - Care Plan - Standard - 22-07-2008.doc</a:displayname> 
      <a:isfolder xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" b:dt="boolean">0</a:isfolder> 
      <e:FriendlyVersionID xmlns:e="urn:schemas-microsoft-com:publishing:">1.0</e:FriendlyVersionID> 
     </a:prop>
    </a:propstat>
  </a:response>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of colly92002

ASKER

Thanks, this has resolved my issue.  I can see a use for both solutions, so points split.