久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

XML 命名空間如何在沒有工作網絡連接的情況下工

How do XML namespaces work without a working network connection?(XML 命名空間如何在沒有工作網絡連接的情況下工作?)
本文介紹了XML 命名空間如何在沒有工作網絡連接的情況下工作?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:context="http://www.springframework.org/schema/context"

       xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/aop
           http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-2.1.xsd">

  <context:component-scan
      base-package="com.springinaction.chapter01.knight" />

</beans>

上面的例子顯示了一個帶有多個命名空間的 XML 文件的例子.這些名稱空間的目的是什么?最重要的是,為什么即使在沒有 Internet 連接的情況下它們也能工作?

The above example shows an example of an XML file with several namespaces. What is the purpose of these namespaces and most importantly why do they work even where there is no Internet connection?

我認為以 xsi:schemaLocation 開頭的第二位包含用于驗證 XML 文檔結構的 XML 模式文件.如果我在不在網絡上的機器上運行使用此配置文件的應用程序,這些為什么仍然有效?這些 URL 是否是 JAR 文件的別名?

I think the second bit that starts with xsi:schemaLocation contains the XML schema files which are used to validate the structure of the XML document. How come these still work if I run the application that uses this configuration file on a machine that is not on a network? Are the URLs somehow aliases to JAR files?

推薦答案

假設我們有這個 XML 文檔.

Let us assume we have this XML document.

<?xml version="1.0" encoding="UTF-8"?>
<html>
      <body>
        Your text here
      </body>
      <body>
        <height>182 cm</height>
        <weight>83 kg</weight>
      </body>
</html>

它包括 HTML,它有一個帶有 HTML 渲染器語義含義的 body 標簽.它還有另一個身體標簽,其中包含有關特定人的信息.命名空間定義了這個標簽的語義范圍.如果沒有命名空間(如提供的示例中所示),解析器就不可能區分它們,因為它們在語法上是相同的.

It includes HTML which has a body tag with a semantic meaning for a HTML renderer. It also has another body tag which carries information about a specific person. A namespace defines a semantic scope for this tag. Without a namespace(as in the example provided), it is impossible for a parser to tell the difference because they are syntactically the same.

這是同一文檔的語義正確版本:

Here is the semantically correct version of the same document:

<?xml version="1.0" encoding="UTF-8"?>
<html:html xmlns:html="http://www.w3.org/TR/xhtml1/">
  <html:body>
    Your text here
  </html:body>
  <human:body xmlns:human="http://www.example.com/human/">
    <human:height>182 cm</human:height>
    <human:weight>83 kg</human:weight>
  </human:body>
</html:html>

因此,多虧了命名空間,我們不必擔心具有不同含義的標簽沖突.

Thus thanks to namespaces we do not have worry about conflicting tags with different meanings.

命名空間 URI 本身從未真正解析過,并且是任意的(因此您可以離線使用它們).

The namespace URIs themselves are never actually resolved, and are arbitrary (thus you can use them offline).

這篇關于XML 命名空間如何在沒有工作網絡連接的情況下工作?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數據庫)
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 国产欧美日韩精品在线观看 | 欧美一级片在线看 | 日韩男人天堂 | 亚洲 自拍 另类 欧美 丝袜 | 91黄色片免费看 | 久久狠狠 | 久草热播 | 久久免费精品 | 久久只有精品 | 欧美午夜视频 | 久久久五月天 | 韩日三级| 精品乱码一区二区三四区视频 | 蜜臀网 | 国产精品久久久久影院色老大 | 日本不卡高清视频 | 网站黄色在线免费观看 | 亚洲欧美日韩一区二区 | 翔田千里一区二区 | 亚洲精品日韩视频 | 亚洲国产精品成人综合久久久 | 在线播放国产一区二区三区 | 亚洲综合三区 | 91精品一区二区三区久久久久 | 国产欧美精品一区二区三区 | 日一区二区 | 国产精品久久久久久久久免费相片 | 久久精品国产免费一区二区三区 | 欧美国产日韩在线观看 | 不用播放器看的av | 亚洲综合国产 | 国产精品久久久久久中文字 | 免费成人在线网站 | 国产一级片一区二区 | 久久新视频 | 中文字幕一区二区三区四区 | 久久99成人 | 中文字字幕在线中文乱码范文 | 久久国产日韩 | 女人夜夜春 | 成人一级毛片 |