Hour5.Putting Namespaces to Use


Hour 5. Putting Namespaces to Use

Namespaces and whitespace; anything that ends with "space" in XML is a pain in the butt.

Jason Hunter

Although it's true that namespaces have caused their fair share of confusion in the XML community, they nonetheless represent a reasonable solution to a tricky problem that is inherent in XML. As you know, XML allows you to create custom markup languages, which are languages that contain elements and attributes of your own creation. XML is incredibly flexible in this regard, but there is nothing stopping two people from creating markup languages with very similar, if not identical, elements and attributes. What happens if you need to use both of these markup languages in a single document? There would obviously be a clash between identically named elements and attributes in the languages. Fortunately, as you will learn in this hour, namespaces provide an elegant solution to this problem.

In this hour, you'll learn

  • Why namespaces are important to XML

  • How namespace names are guaranteed to be unique

  • How to declare and reference namespaces in XML documents

  • How to use namespaces to merge schemas




Sams Teach Yourself XML in 24 Hours
Sams Teach Yourself XML in 24 Hours, Complete Starter Kit (3rd Edition)
ISBN: 067232797X
EAN: 2147483647
Year: 2005
Pages: 266

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net