gpt4 book ai didi

xml - 设置我自己的 XML 命名空间?

转载 作者:数据小太阳 更新时间:2023-10-29 01:44:20 27 4
gpt4 key购买 nike

如何设置我自己的 XML 命名空间?

最佳答案

只需在根标记中(或任何需要命名空间的地方)定义一个命名空间。示例:

<root xmlns:ns="some_identifier">

ns 和标识符可以是(几乎)任何东西。 See this quote :

What Do Namespace Names Point At?

One of the confusing things about all this is that namespace names are URLs; it's easy to assume that since they're Web addresses, they must be the address of something. They're not; these are URLs, but the namespace draft doesn't care what (if anything) they point at. Think about the example of the XML.com programmer looking for book titles; that works fine without the namespace name pointing at anything.

The reason that the W3C decided to use URLs as namespace names is that they contain domain names (e.g. www.xml.com), which work globally across the Internet.

Wikipedia article信息量也很大。

我希望您知道您需要命名空间只是为了区分具有相同名称的标签。

关于xml - 设置我自己的 XML 命名空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5071948/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com