Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XML node attribute vanishes
Message
From
25/12/2012 02:39:25
 
 
To
24/12/2012 20:35:57
General information
Forum:
ASP.NET
Category:
XML
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01560521
Message ID:
01560596
Views:
35
>>Well, you certainly shouldn't have to clone (assuming the XmlDocument and the NameSpaceManager do not change - but since the method references objects which are external it's a bit difficult to know what else might be going on.
>
>oXmlDocument is initialized at one location. Then, I can use use at several locations. This is one method. I use it to select a single node. This goes in oXmlNode. Then, from oXmlNode, I would like to collect all attributes. This works well on the first run. But, without cloning, on the second run, something was mixing in memory.
>
>oXmlAttributeCollection is only initialized here but it is not used so far. However, the RemoveAll() method might not have been best to initialize it. Maybe as mentioned in the other message I should have used an approach to set it to nothing.

Then, as Gregory points out:
First time through you use oXmlAttributeCollection to reference the attributes of the node in question. Since oXmlAttributeCollection is defined externally it is still in scope when the routine is called for the second time for the same node so all the attributes are removed - thus you won't find any.....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform