How to define a namespace in XML?

前端 未结 1 1432
萌比男神i
萌比男神i 2021-01-24 09:26

I use Eclipse for J2EE programming. In the HTML code, we can use the JSF (or any other) namespaces using the xmlns attribute. Once you specify a namespace using the xmlns attrib

1条回答
  •  北海茫月
    2021-01-24 09:47

    If it's just the namespace, all you need to do is pick a URL that is guaranteed to be unique and use it as your namespace. A common convention is to use a URL under a domain you own, e.g. http://www.idiotguy.com/my-super-xml-namespace.

    The namespace by itself doesn't say anything about the document structure though; for that, you need to write a DTD or XSD and link your document to it.

    0 讨论(0)
提交回复
热议问题