zoukankan      html  css  js  c++  java
  • XML Namespace

    http://www.w3schools.com/xml/xml_namespaces.asp

    XML Namespaces provide a method to avoid element name conflicts.

    When using prefixes in XML, a so-called namespace for the prefix must be defined.

    The namespace is defined by the xmlns attribute in the start tag of an element.

    The namespace declaration has the following syntax. xmlns:prefix="URI".

    <root>

    <h:table xmlns:h="http://www.w3.org/TR/html4/">
      <h:tr>
        <h:td>Apples</h:td>
        <h:td>Bananas</h:td>
      </h:tr>
    </h:table>

    <f:table xmlns:f="http://www.w3schools.com/furniture">
      <f:name>African Coffee Table</f:name>
      <f:width>80</f:width>
      <f:length>120</f:length>
    </f:table>

    </root>

    In the example above, the xmlns attribute in the <table> tag give the h: and f: prefixes a qualified namespace.

    When a namespace is defined for an element, all child elements with the same prefix are associated with the same namespace.

    Namespaces can be declared in the elements where they are used or in the XML root element:

    <root
    xmlns:h="http://www.w3.org/TR/html4/"
    xmlns:f="http://www.w3schools.com/furniture"
    >

    <h:table>
      <h:tr>
        <h:td>Apples</h:td>
        <h:td>Bananas</h:td>
      </h:tr>
    </h:table>

    <f:table>
      <f:name>African Coffee Table</f:name>
      <f:width>80</f:width>
      <f:length>120</f:length>
    </f:table>

    </root>

    Note: The namespace URI is not used by the parser to look up information.

    The purpose is to give the namespace a unique name. However, often companies use the namespace as a pointer to a web page containing namespace information.

  • 相关阅读:
    jmeter(1)工具使用--L
    fiddler(17)插件
    fiddler(16)安卓抓包 、ios抓包
    fiddler(15)firefox
    fiddler(14)https抓包
    fiddler(13)弱网
    fiddler(12)断点
    fiddler(11)FiddlerScript-log-Timeline
    fiddler(10)Filter
    fiddler(9)辅助标签和工具(统计-检查器-自动响应-设计请求)
  • 原文地址:https://www.cnblogs.com/wucg/p/2093560.html
Copyright © 2011-2022 走看看