Hello.
I'm developing a web comsuming client using VS.NET 2003(VB), .NET
Framework 1.1.4322, ASP.NET 1.1.4322, WSE2.0 on a WinXP Pro Sp2 computer.
Using this code that i copied from a book:
Dim headTxt As String = ""
Me.txtNodeInfo.Text = " "
Dim xpNav As XPathNavigator = xpDoc.CreateNavigator()
xpNav.MoveToRoot()
xpNav.MoveToFirstChild()
headTxt = "Currently Positioned at: "
txtNodeInfo.Text = Me.txtNodeInfo.Text & headTxt & xpNav.Name &
System.Environment.NewLine
Dim fUpDate As Boolean = xpNav.MoveToAttribute("xmlns", String.Empty)
headTxt = "Found xmlns attribute: "
txtNodeInfo.Text = Me.txtNodeInfo.Text & headTxt & fUpDate &
System.Environment.NewLine
xpNav.MoveToNextAttribute()
headTxt = "Found first attribute called: "
txtNodeInfo.Text = Me.txtNodeInfo.Text & headTxt & xpNav.Name &
System.Environment.NewLine
fUpDate = xpNav.MoveToNextAttribute()
headTxt = "Another attribute found at: "
txtNodeInfo.Text = Me.txtNodeInfo.Text & headTxt & fUpDate &
System.Environment.NewLine
On the partial XML document at the end of this post, I'm getting these
results:
Currently Positioned at: TripExportDataObject
Found xmlns attribute: False
Found first attribute called: TripExportDataObject
Another attribute found at: False
Why is "Found xmlns attribute:" returning Falase ?
Any help would be gratefully appreciated.
Thanks,
Tony
======================= XML Document(xpDoc) ===================
(This not the complete XML document)
<TripExportDataObject
xmlns="http://tempuri.org/TripExportDataObject.xsd"><Trip><TripID>70</TripID><CurrentRevisionNumber>1</CurrentRevisionNumber><IsDispatch>false</IsDispatch><IsActive>false</IsActive><IsComplete>true</IsComplete><IsArchived>true</IsArchived><XVIN>67112641</XVIN><OrganizationID>1214</OrganizationID><UserDefinedRouteID>0</UserDefinedRouteID><StartDate>2005-05-27T04:00:01.0000000-05:00</StartDate><EndDate>2005-05-27T19:33:00.0000000-05:00</EndDate><LastMessageDate>2005-05-27T19:33:44.6700000-05:00</LastMessageDate><TripType>OperationProfile</TripType><TimeVariance>0</TimeVariance><DateLastModified>2005-05-27T19:33:44.9670000-05:00</DateLastModified><TripData><Trip
InternalElementID="1" TripType="OperationProfile">
<Actual InternalElementID="2" UserDefinedRouteID="0" XVIN="67112641"
BegDateTime="2005-05-27T04:00:01" EndDateTime="2005-05-27T19:33:00"
BegLatitude="0" BegLongitude="0" EndLatitude="0" EndLongitude="0"
StartingRoadwayStatus="Taxable">
<OpProfileSession InternalElementID="3"