XML Tutorial #7 : Namespace scope ..

In this tutorial i am gonna talk about xml namespace scope … you may read about variable scope in c or c++ language .. however in xml namespace also have some scope ..

That is when you define an xml namespace for an element it will only work for that element and its contained descendants, this is know as the defined namespaces working area .. it does not work if you prefix the same namespace for another element or child that is not within the element where we defined the namespaces .. Look at the below example ..
<?xml version=”1.0″ encoding=”ISO-8859-1″?>

<bookstore>
<book>
<title>Teach yourself C++</title>
<price>255</price>
<b:author xmlns:b=”http://facebook.com/home/”&gt;
<b:name>Herbert Schield</b:name>
<b:language>English</b:language>
</b:author>
</book>

</bookstore>

By kfelahi Posted in XML

Leave a comment