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>

Advertisements
By kfelahi Posted in XML

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s