Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XML, .config files, and which to use
Message
From
07/11/2005 17:25:21
 
 
To
All
General information
Forum:
ASP.NET
Category:
XML
Title:
XML, .config files, and which to use
Miscellaneous
Thread ID:
01066221
Message ID:
01066221
Views:
58
I want to save some configuration information about a specific server machine in some kind of XML file.

I started by deciding on the information structure, hand coding it in XML, and then using VS.NET to create a schema (.xsd file) for me. Since this information regarded how the machine was configured, I used the .config extension.

In my code, I tried to use the SelectSingleNode(string xpath) method to get the node that I wanted, but it kept returning null. It was my first time using XML files with .NET or using xpaths. I thrashed for a few hours until I determined that it was the top level tag's xmlns attribute.
<ServerInfo xmlns="http://tempuri.org/ServerInfo.xsd">
If I cut out the xmlns attribute, the SelectSingleNode(string xpath) method returned the node that I needed. I tried renaming the file to change the file extension to .xml extension, but that didn't help, either.

For now, I am just continuing on without the attribute. It would be nice, though, for the XML file to be aware of the schema so that when editing the file, Intellisense could be utilized.

Anyone understand what my problem is with the xmlns attribute?
David S. Alexander
Kettley Publishing
20271 SW Birch Street, 2nd Floor
Newport Beach, CA 92660-1752
Next
Reply
Map
View

Click here to load this message in the networking platform