XML Tutorial #8 : Multiple Namespaces

<?xml version=”1.0″ encoding=”utf-8″?>

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

</bookstore>
Have a close look at the above multiple namespace example … we define two namespaces one is for book element and another is for author element .. however you can use use the namespace of book element in the language element but you can’t use the namespace of author into any other elements that are not descendant of author …

and don’t panic about url the i have used … 🙂

Hope you understand …

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