xmlxml-namespaces

when to use a URN for xmlns


For a "hello world" type xml document:

<?xml version="1.0" encoding="UTF-8"?>
<!-- see http://www.w3.org/TR/REC-xml-names/ -->
<bk:book xmlns:bk="urn:loc.gov:books" xmlns:isbn="urn:ISBN:0-395-36341-6">
  <bk:title>Cheaper by the Dozen</bk:title>
  <isbn:number>1568491379</isbn:number>
</bk:book>

you can arbitrarily define urn's on the fly for custom purposes?


Solution

  • In short, yes. You can make 'em up as you like.