when to use a URN for xmlns

家住魔仙堡 提交于 2019-12-10 03:54:34

问题


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?


回答1:


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




回答2:


I found this answer quite useful, and it led me to this article which seems to say that yes you can make them up as you like, and indeed you SHOULD, if you aren't going to place a document online for a given URL.



来源:https://stackoverflow.com/questions/4116282/when-to-use-a-urn-for-xmlns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!