
406Microsoft Visual Studio 2010: A Beginner’s Guide
Namespaces
Another important part of XML that you’ll need to understand is namespaces. In Chapter 2, you learned how namespaces in C# and VB help give a unique identity to code within a given namespace. The purpose of namespaces in XML is similar. In the case of Listing
TIP
You might have noticed that the namespaces in Listing
Listing A-2 XML namespace example
<?xml version="1.0"
<a:address>123 4th St</a:address> </customer>
Namespaces are specified by placing an xmlns attribute on an element, either with or without a prefix. The xmlns without a prefix specifies the default namespace for all of the elements where the namespace resides and child elements of the element where the namespace resides. This means that customer and name are in the
Namespaces can also have prefixes to help you target where they are applied. In Listing