On 23.3.2006, at 15:24, Stephen Tallent wrote:
By fails then I mean it just does not return the node that it is
supposed to do.
Hi Bjorn. Can you post some code consuming these two functions that
illustrates the issue? I did a quick test in 2k6r1 and these two
functioned identically as they should.
Hello Stephen
Here is the XML:
<soap:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soap="http://schemas.xmlsoap.org/soap/
envelope/"><GetAllPackagesResponse xmlns="http://einhugur.com/
KeyServer/"><GetAllPackagesResult><anyType xsi:type="Package"><ID>1</
ID><Name>default</Name><IsDefault>true</IsDefault></anyType></
GetAllPackagesResult></GetAllPackagesResponse></soap:Body>
And here is the code that fails
Dim xml as XmlDocument
Dim responseNode as XmlNode
xml = new XmlDocument(sr.body.ToString())
responseNode = xml.DocumentElement.Node
("GetAllPackagesResponse") // I get nil here when using the XQL code
The Xql code:
Function Node(extends element as XmlNode,name as String) As XmlNode
dim nodelist as xmlnodeList
nodelist = element.Xql(name)
if nodelist.length > 0 then
return nodelist.item(0)
end if
return nil
exception e as xmlException
End Function
The non Xql code:
Function Node(extends element as XmlNode,name as String) As XmlNode
Dim i as Integer
for i = 0 to element.ChildCount-1
if element.Child(i).Name = name then
return element.Child(i)
end if
next
return nil
End Function
--
______________________________________________________________________
Björn Eiríksson [EMAIL PROTECTED]
Einhugur Software
http://www.einhugur.com/
______________________________________________________________________
Einhugur Software has sold its products in 52 countries world wide.
______________________________________________________________________
For support: [EMAIL PROTECTED]
To post on the maillist: [EMAIL PROTECTED]
_______________________________________________
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>