Thanks,
I guess I have shown how little I know about Xql. But I can see now
that what you say makes perfect sense.
Björn
On 23.3.2006, at 17:13, Stephen Tallent wrote:
Here is the XML:
Ah. I see the problem. You aren't handling the namespaces
correctly. You are asking for GetAllPackagesResult, but aren't
accounting for the fact that it is in a namespace. If I recall,
you are a .net developer. In .net when calling
System.xml.XmlNode.SelectNodes and asking for a namespaced node,
you have to pass an XmlNamespaceManager to it in addition to the
xpath query. In RB (and it was like this in 2k5, too) you have to
essentially do the same thing.
This code isn't in your Node() function example, but illustrates
how to correctly query for a namespaced node:
---------------
dim xdoc as new xmldocument
dim ns as new xmlnamespaces
xdoc.LoadXml("bjorns soapy xml")
ns.uri("ein") = "http://einhugur.com/KeyServer/"
xlist = xdoc.DocumentElement.xql("ein:GetAllPackagesResponse", ns)
msgbox str(xlist.Length)
---------------
Now how you want to incorporate that into your generic Node class
is up to you, but you could follow Microsoft's convention and have
something like:
Node(name as string)
Node(name as string, nsmngr as xmlnamespaces)
Hope this helps.
-stephen
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>