選單
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

XML 教程

XML HOME XML Introduction XML How to use XML Tree XML Syntax XML Elements XML Attributes XML Namespaces XML Display XML HttpRequest XML Parser XML DOM XML XPath XML XSLT XML XQuery XML XLink XML Validator XML DTD XML Schema XML Server XML Examples XML Quiz XML Certificate

XML AJAX

AJAX Introduction AJAX XMLHttp AJAX Request AJAX Response AJAX XML File AJAX PHP AJAX ASP AJAX Database AJAX Applications AJAX Examples

XML DOM

DOM Introduction DOM Nodes DOM Accessing DOM Node Info DOM Node List DOM Traversing DOM Navigating DOM Get Values DOM Change Nodes DOM Remove Nodes DOM Replace Nodes DOM Create Nodes DOM Add Nodes DOM Clone Nodes DOM Examples

XPath 教程

XPath Introduction XPath Nodes XPath Syntax XPath Axes XPath Operators XPath Examples

XSLT 教程

XSLT Introduction XSL Languages XSLT Transform XSLT <template> XSLT <value-of> XSLT <for-each> XSLT <sort> XSLT <if> XSLT <choose> XSLT Apply XSLT on the Client XSLT on the Server XSLT Edit XML XSLT Examples

XQuery 教程

XQuery Introduction XQuery Example XQuery FLWOR XQuery HTML XQuery Terms XQuery Syntax XQuery Add XQuery Select XQuery Functions

XML DTD

DTD Introduction DTD Building Blocks DTD Elements DTD Attributes DTD Elements vs Attr DTD Entities DTD Examples

XSD Schema

XSD Introduction XSD How To XSD <schema> XSD Elements XSD Attributes XSD Restrictions XSD Complex Elements XSD Empty XSD Elements-only XSD Text-only XSD Mixed XSD Indicators XSD <any> XSD <anyAttribute> XSD Substitution XSD Example

XSD Data Types

XSD String XSD Date/Time XSD Numeric XSD Misc XSD Reference

Web Services

XML Services XML WSDL XML SOAP XML RDF XML RSS

參考手冊

DOM Node Types DOM Node DOM NodeList DOM NamedNodeMap DOM Document DOM Element DOM Attribute DOM Text DOM CDATA DOM Comment DOM XMLHttpRequest DOM Parser XSLT Elements XSLT/XPath Functions

XML Schema any 元素


❮ 完整的 XML Schema 參考

定義和用法

any 元素使作者能夠用模式中未指定的元素來擴充套件 XML 文件。

元素資訊

  • 父元素: choice, sequence

語法

<any
id=ID
maxOccurs=nonNegativeInteger|unbounded
minOccurs=nonNegativeInteger
namespace=namespace
processContents=lax|skip|strict
任何屬性
>

(annotation?)

</any>

(? 符號聲明瞭該元素可以在 any 元素內出現零次或一次)

Attribute 描述
id 可選。指定元素的唯一 ID
maxOccurs 可選。指定 any 元素在父元素中出現的最大次數。該值可以是任何大於等於 0 的數字,或者如果你想設定最大次數沒有限制,請使用值“unbounded”。預設值為 1。
minOccurs 可選。指定 any 元素在父元素中出現的最小次數。該值可以是任何大於等於 0 的數字。預設值為 1。
namespace 可選。指定可以使用的元素所在的名稱空間。可以設定為以下之一:
  • ##any - 允許來自任何名稱空間的元素(這是預設值)
  • ##other - 可以存在來自非父元素名稱空間的任何名稱空間的元素
  • ##local - 元素必須來自無名稱空間
  • ##targetNamespace - 可以存在來自父元素名稱空間的元素
  • List of {URI references of namespaces, ##targetNamespace, ##local} - 可以存在來自名稱空間空格分隔列表的元素
processContents 可選。指定 XML 處理器應如何處理根據此 any 元素指定的元素的驗證。可以設定為以下之一:
  • strict - XML 處理器必須獲取必需名稱空間的模式並驗證元素(這是預設值)
  • lax - 同 strict,但如果無法獲取模式,則不會發生錯誤
  • skip - XML 處理器不嘗試驗證指定名稱空間中的任何元素
任何屬性 可選。指定任何其他非 schema 名稱空間的屬性

示例 1

以下示例顯示了一個名為“person”的元素的宣告。透過使用 <any> 元素,作者可以在“person”的內容之後(在 <lastname> 之後)新增任何元素來擴充套件它。

<xs:element name="person">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="firstname" type="xs:string"/>
      <xs:element name="lastname" type="xs:string"/>
      <xs:any minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

❮ 完整的 XML Schema 參考
×

聯絡銷售

如果您想將 W3Schools 服務用於教育機構、團隊或企業,請傳送電子郵件給我們
sales@w3schools.com

報告錯誤

如果您想報告錯誤,或想提出建議,請傳送電子郵件給我們
help@w3schools.com

W3Schools 經過最佳化,旨在方便學習和培訓。示例可能經過簡化,以提高閱讀和學習體驗。教程、參考資料和示例會不斷審查,以避免錯誤,但我們無法保證所有內容的完全正確性。使用 W3Schools 即表示您已閱讀並接受我們的使用條款Cookie 和隱私政策

版權所有 1999-2024 Refsnes Data。保留所有權利。W3Schools 由 W3.CSS 提供支援