{"id":97819,"date":"2026-08-30T10:16:51","date_gmt":"2026-08-30T02:16:51","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/97819.html"},"modified":"2026-08-30T10:16:51","modified_gmt":"2026-08-30T02:16:51","slug":"xml-schema-anyattribute-%e5%85%83%e7%b4%a0%e8%af%a6%e8%a7%a3%ef%bc%9a%e4%bb%8e%e5%85%a5%e9%97%a8%e5%88%b0%e5%ae%9e%e6%88%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/97819.html","title":{"rendered":"XML Schema anyAttribute \u5143\u7d20\u8be6\u89e3\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u6218"},"content":{"rendered":"<h3>1. \u5f15\u8a00<\/h3>\n<p>\u5728 XML Schema \u4e2d&#xff0c;anyAttribute \u5143\u7d20\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u4f46\u5e38\u88ab\u5ffd\u89c6\u7684\u7279\u6027\u3002\u5b83\u5141\u8bb8\u4f60\u5728\u4e00\u4e2a\u590d\u6742\u7c7b\u578b\u4e2d\u58f0\u660e&#034;\u4efb\u610f\u5c5e\u6027&#034;&#xff0c;\u4ece\u800c\u4e3a XML \u6587\u6863\u63d0\u4f9b\u6781\u5927\u7684\u6269\u5c55\u6027\u3002\u65e0\u8bba\u662f\u5904\u7406\u7b2c\u4e09\u65b9\u6570\u636e\u3001\u6784\u5efa\u53ef\u63d2\u62d4\u7684\u914d\u7f6e\u7cfb\u7edf&#xff0c;\u8fd8\u662f\u8bbe\u8ba1\u5f00\u653e\u5f0f\u7684\u534f\u8bae\u683c\u5f0f&#xff0c;anyAttribute \u90fd\u80fd\u6d3e\u4e0a\u7528\u573a\u3002<\/p>\n<p>\u672c\u6587\u5c06\u7cfb\u7edf\u8bb2\u89e3 anyAttribute \u7684\u8bed\u6cd5\u3001\u5c5e\u6027\u3001\u547d\u540d\u7a7a\u95f4\u7ea6\u675f\u3001\u4e0e any \u5143\u7d20\u7684\u533a\u522b&#xff0c;\u5e76\u901a\u8fc7\u5927\u91cf\u53ef\u8fd0\u884c\u7684\u4ee3\u7801\u5b9e\u4f8b\u5e2e\u52a9\u4f60\u5f7b\u5e95\u638c\u63e1\u8fd9\u4e00\u7279\u6027\u3002<\/p>\n<h3>2. anyAttribute \u57fa\u7840\u8bed\u6cd5<\/h3>\n<p>anyAttribute \u5143\u7d20\u7528\u4e8e\u5728\u590d\u6742\u7c7b\u578b\u4e2d\u58f0\u660e\u4e00\u4e2a&#034;\u901a\u914d\u7b26&#034;&#xff0c;\u8868\u793a\u8be5\u7c7b\u578b\u53ef\u4ee5\u63a5\u53d7\u4efb\u610f\u5c5e\u6027\u3002\u5176\u57fa\u672c\u8bed\u6cd5\u5982\u4e0b&#xff1a;<\/p>\n<p>&lt;xs:complexType name&#061;&#034;PersonType&#034;&gt;<br \/>\n    &lt;xs:sequence&gt;<br \/>\n        &lt;xs:element name&#061;&#034;name&#034; type&#061;&#034;xs:string&#034;\/&gt;<br \/>\n        &lt;xs:element name&#061;&#034;age&#034; type&#061;&#034;xs:integer&#034;\/&gt;<br \/>\n    &lt;\/xs:sequence&gt;<br \/>\n    &lt;xs:anyAttribute\/&gt;<br \/>\n&lt;\/xs:complexType&gt;<\/p>\n<p>\u4e0a\u9762\u7684\u58f0\u660e\u8868\u793a&#xff1a;PersonType \u7c7b\u578b\u9664\u4e86\u5305\u542b name \u548c age \u4e24\u4e2a\u5143\u7d20\u5916&#xff0c;\u8fd8\u53ef\u4ee5\u643a\u5e26\u4efb\u610f\u6570\u91cf\u7684\u989d\u5916\u5c5e\u6027\u3002\u4f8b\u5982&#xff0c;\u4e0b\u9762\u8fd9\u4e2a XML \u5b9e\u4f8b\u662f\u5408\u6cd5\u7684&#xff1a;<\/p>\n<p>&lt;person name&#061;&#034;\u5f20\u4e09&#034; age&#061;&#034;30&#034; email&#061;&#034;zhangsan&#064;example.com&#034; city&#061;&#034;\u5317\u4eac&#034;\/&gt;<\/p>\n<p>\u5176\u4e2d email \u548c city \u5c31\u662f\u901a\u8fc7 anyAttribute \u5f15\u5165\u7684\u4efb\u610f\u5c5e\u6027\u3002<\/p>\n<h3>3. anyAttribute \u7684\u5c5e\u6027\u8be6\u89e3<\/h3>\n<p>anyAttribute \u5143\u7d20\u652f\u6301\u4e09\u4e2a\u5173\u952e\u5c5e\u6027&#xff1a;namespace\u3001processContents \u548c id\u3002\u4e0b\u9762\u9010\u4e00\u8bf4\u660e\u3002<\/p>\n<h4>3.1 namespace \u5c5e\u6027<\/h4>\n<p>namespace \u5c5e\u6027\u7528\u4e8e\u9650\u5b9a\u5141\u8bb8\u51fa\u73b0\u7684\u5c5e\u6027\u6240\u5c5e\u7684\u547d\u540d\u7a7a\u95f4\u3002\u53ef\u9009\u503c\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>##any&#xff1a;\u5141\u8bb8\u4efb\u610f\u547d\u540d\u7a7a\u95f4\u7684\u5c5e\u6027&#xff08;\u9ed8\u8ba4\u503c&#xff09;\u3002<\/li>\n<li>##other&#xff1a;\u5141\u8bb8\u9664\u76ee\u6807\u547d\u540d\u7a7a\u95f4\u4ee5\u5916\u7684\u4efb\u610f\u547d\u540d\u7a7a\u95f4\u7684\u5c5e\u6027\u3002<\/li>\n<li>##local&#xff1a;\u4ec5\u5141\u8bb8\u65e0\u547d\u540d\u7a7a\u95f4\u7684\u5c5e\u6027\u3002<\/li>\n<li>##targetNamespace&#xff1a;\u4ec5\u5141\u8bb8\u76ee\u6807\u547d\u540d\u7a7a\u95f4\u7684\u5c5e\u6027\u3002<\/li>\n<li>\u5177\u4f53\u7684\u547d\u540d\u7a7a\u95f4 URI \u5217\u8868&#xff08;\u7528\u7a7a\u683c\u5206\u9694&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u793a\u4f8b&#xff1a;\u53ea\u5141\u8bb8\u6765\u81ea http:\/\/www.example.com\/ext \u547d\u540d\u7a7a\u95f4\u7684\u989d\u5916\u5c5e\u6027&#xff1a;<\/p>\n<p>&lt;xs:complexType name&#061;&#034;ProductType&#034;&gt;<br \/>\n    &lt;xs:sequence&gt;<br \/>\n        &lt;xs:element name&#061;&#034;name&#034; type&#061;&#034;xs:string&#034;\/&gt;<br \/>\n    &lt;\/xs:sequence&gt;<br \/>\n    &lt;xs:anyAttribute namespace&#061;&#034;http:\/\/www.example.com\/ext&#034;\/&gt;<br \/>\n&lt;\/xs:complexType&gt;<\/p>\n<h4>3.2 processContents \u5c5e\u6027<\/h4>\n<p>processContents \u5c5e\u6027\u63a7\u5236\u9a8c\u8bc1\u5668\u5982\u4f55\u5904\u7406\u8fd9\u4e9b\u4efb\u610f\u5c5e\u6027&#xff0c;\u53d6\u503c\u5982\u4e0b&#xff1a;<\/p>\n<ul>\n<li>strict&#xff1a;\u5fc5\u987b\u80fd\u5728 Schema \u4e2d\u627e\u5230\u5bf9\u5e94\u5c5e\u6027\u7684\u58f0\u660e&#xff0c;\u5426\u5219\u9a8c\u8bc1\u5931\u8d25\u3002<\/li>\n<li>lax&#xff1a;\u5982\u679c Schema \u4e2d\u5b58\u5728\u5bf9\u5e94\u58f0\u660e\u5219\u9a8c\u8bc1&#xff0c;\u5426\u5219\u5ffd\u7565\u3002<\/li>\n<li>skip&#xff1a;\u4e0d\u8fdb\u884c\u4efb\u4f55\u9a8c\u8bc1&#xff08;\u9ed8\u8ba4\u503c&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u793a\u4f8b&#xff1a;\u8981\u6c42\u989d\u5916\u5c5e\u6027\u5fc5\u987b\u901a\u8fc7 Schema \u9a8c\u8bc1&#xff1a;<\/p>\n<p>&lt;xs:anyAttribute processContents&#061;&#034;strict&#034;\/&gt;<\/p>\n<h4>3.3 id \u5c5e\u6027<\/h4>\n<p>id \u5c5e\u6027\u7528\u4e8e\u4e3a anyAttribute \u5143\u7d20\u6307\u5b9a\u552f\u4e00\u6807\u8bc6&#xff0c;\u4fbf\u4e8e\u6587\u6863\u5185\u90e8\u5f15\u7528&#xff0c;\u5b9e\u9645\u4f7f\u7528\u8f83\u5c11\u3002<\/p>\n<h3>4. \u5b8c\u6574\u5b9e\u6218\u793a\u4f8b<\/h3>\n<p>\u4e0b\u9762\u901a\u8fc7\u4e00\u4e2a\u5b8c\u6574\u7684\u6848\u4f8b&#xff0c;\u5c55\u793a anyAttribute \u5728\u771f\u5b9e\u573a\u666f\u4e2d\u7684\u5e94\u7528\u3002\u5047\u8bbe\u6211\u4eec\u8981\u8bbe\u8ba1\u4e00\u4e2a\u901a\u7528\u7684&#034;\u914d\u7f6e\u9879&#034;\u7c7b\u578b&#xff0c;\u5141\u8bb8\u7528\u6237\u9644\u52a0\u81ea\u5b9a\u4e49\u5c5e\u6027\u3002<\/p>\n<h4>4.1 \u5b9a\u4e49 Schema<\/h4>\n<p>&lt;?xml version&#061;&#034;1.0&#034; encoding&#061;&#034;UTF-8&#034;?&gt;<br \/>\n&lt;xs:schema xmlns:xs&#061;&#034;http:\/\/www.w3.org\/2001\/XMLSchema&#034;<br \/>\n           xmlns:cfg&#061;&#034;http:\/\/www.example.com\/config&#034;<br \/>\n           targetNamespace&#061;&#034;http:\/\/www.example.com\/config&#034;<br \/>\n           elementFormDefault&#061;&#034;qualified&#034;&gt;<br \/>\n&amp;lt;xs:element name&#061;&#034;config&#034; type&#061;&#034;cfg:ConfigType&#034;\/&amp;gt;<br \/>\n&amp;lt;xs:complexType name&#061;&#034;ConfigType&#034;&amp;gt;<br \/>\n&amp;lt;xs:sequence&amp;gt;<br \/>\n&amp;lt;xs:element name&#061;&#034;item&#034; type&#061;&#034;cfg:ItemType&#034; maxOccurs&#061;&#034;unbounded&#034;\/&amp;gt;<br \/>\n&amp;lt;\/xs:sequence&amp;gt;<br \/>\n&amp;lt;xs:anyAttribute namespace&#061;&#034;##other&#034; processContents&#061;&#034;lax&#034;\/&amp;gt;<br \/>\n&amp;lt;\/xs:complexType&amp;gt;<br \/>\n&amp;lt;xs:complexType name&#061;&#034;ItemType&#034;&amp;gt;<br \/>\n&amp;lt;xs:attribute name&#061;&#034;key&#034; type&#061;&#034;xs:string&#034; use&#061;&#034;required&#034;\/&amp;gt;<br \/>\n&amp;lt;xs:attribute name&#061;&#034;value&#034; type&#061;&#034;xs:string&#034; use&#061;&#034;required&#034;\/&amp;gt;<br \/>\n&amp;lt;xs:anyAttribute processContents&#061;&#034;skip&#034;\/&amp;gt;<br \/>\n&amp;lt;\/xs:complexType&amp;gt;<br \/>\n&lt;\/xs:schema&gt;<\/p>\n<h4>4.2 \u5bf9\u5e94\u7684 XML \u5b9e\u4f8b<\/h4>\n<p>&lt;?xml version&#061;&#034;1.0&#034; encoding&#061;&#034;UTF-8&#034;?&gt;<br \/>\n&lt;cfg:config xmlns:cfg&#061;&#034;http:\/\/www.example.com\/config&#034;<br \/>\n            xmlns:meta&#061;&#034;http:\/\/www.example.com\/meta&#034;<br \/>\n            meta:version&#061;&#034;1.2&#034; meta:author&#061;&#034;\u5f20\u4e09&#034;&gt;<br \/>\n    &lt;cfg:item key&#061;&#034;timeout&#034; value&#061;&#034;30&#034; priority&#061;&#034;high&#034;\/&gt;<br \/>\n    &lt;cfg:item key&#061;&#034;retry&#034; value&#061;&#034;3&#034; debug&#061;&#034;true&#034;\/&gt;<br \/>\n&lt;\/cfg:config&gt;<\/p>\n<p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d&#xff1a;<\/p>\n<ul>\n<li>config \u5143\u7d20\u4e0a\u7684 meta:version \u548c meta:author \u5c5e\u6027\u6765\u81ea ##other \u5141\u8bb8\u7684\u5916\u90e8\u547d\u540d\u7a7a\u95f4\u3002<\/li>\n<li>item \u5143\u7d20\u4e0a\u7684 priority \u548c debug \u5c5e\u6027\u662f\u65e0\u547d\u540d\u7a7a\u95f4\u7684\u4efb\u610f\u5c5e\u6027&#xff0c;\u901a\u8fc7 processContents&#061;&#034;skip&#034; \u8df3\u8fc7\u9a8c\u8bc1\u3002<\/li>\n<\/ul>\n<h3>5. anyAttribute \u4e0e any \u5143\u7d20\u7684\u533a\u522b<\/h3>\n<p>\u521d\u5b66\u8005\u5bb9\u6613\u6df7\u6dc6 anyAttribute \u548c any \u5143\u7d20\u3002\u4e24\u8005\u7684\u6838\u5fc3\u533a\u522b\u5728\u4e8e\u4f5c\u7528\u5bf9\u8c61&#xff1a;<\/p>\n<table>\n<tr>\u5bf9\u6bd4\u9879anyAttributeany<\/tr>\n<tbody>\n<tr>\n<td>\u4f5c\u7528\u5bf9\u8c61<\/td>\n<td>\u5c5e\u6027&#xff08;attribute&#xff09;<\/td>\n<td>\u5143\u7d20&#xff08;element&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u51fa\u73b0\u4f4d\u7f6e<\/td>\n<td>complexType \u5185\u90e8&#xff0c;\u4e0e attribute \u540c\u7ea7<\/td>\n<td>sequence \/ choice \/ all \u5185\u90e8<\/td>\n<\/tr>\n<tr>\n<td>\u5178\u578b\u7528\u9014<\/td>\n<td>\u5141\u8bb8\u7c7b\u578b\u643a\u5e26\u672a\u77e5\u5c5e\u6027<\/td>\n<td>\u5141\u8bb8\u7c7b\u578b\u5305\u542b\u672a\u77e5\u5b50\u5143\u7d20<\/td>\n<\/tr>\n<tr>\n<td>\u5e38\u7528\u5c5e\u6027<\/td>\n<td>namespace\u3001processContents<\/td>\n<td>namespace\u3001processContents\u3001maxOccurs<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u793a\u4f8b&#xff1a;\u540c\u65f6\u4f7f\u7528 any \u548c anyAttribute&#xff1a;<\/p>\n<p>&lt;xs:complexType name&#061;&#034;FlexibleType&#034;&gt;<br \/>\n    &lt;xs:sequence&gt;<br \/>\n        &lt;xs:any processContents&#061;&#034;lax&#034; minOccurs&#061;&#034;0&#034; maxOccurs&#061;&#034;unbounded&#034;\/&gt;<br \/>\n    &lt;\/xs:sequence&gt;<br \/>\n    &lt;xs:anyAttribute processContents&#061;&#034;lax&#034;\/&gt;<br \/>\n&lt;\/xs:complexType&gt;<\/p>\n<h3>6. \u9ad8\u7ea7\u7528\u6cd5\u4e0e\u6ce8\u610f\u4e8b\u9879<\/h3>\n<h4>6.1 \u4e0e\u5177\u4f53\u5c5e\u6027\u5171\u5b58<\/h4>\n<p>anyAttribute \u53ef\u4ee5\u4e0e\u663e\u5f0f\u58f0\u660e\u7684\u5c5e\u6027\u5171\u5b58&#xff0c;\u4f46\u8981\u6ce8\u610f&#xff1a;\u663e\u5f0f\u5c5e\u6027\u4f18\u5148\u5339\u914d&#xff0c;anyAttribute \u53ea\u8d1f\u8d23&#034;\u515c\u5e95&#034;\u672a\u58f0\u660e\u7684\u5c5e\u6027\u3002<\/p>\n<p>&lt;xs:complexType name&#061;&#034;DocumentType&#034;&gt;<br \/>\n    &lt;xs:attribute name&#061;&#034;id&#034; type&#061;&#034;xs:ID&#034; use&#061;&#034;required&#034;\/&gt;<br \/>\n    &lt;xs:anyAttribute namespace&#061;&#034;##other&#034; processContents&#061;&#034;lax&#034;\/&gt;<br \/>\n&lt;\/xs:complexType&gt;<\/p>\n<h4>6.2 \u4f7f\u7528 Java \u89e3\u6790\u5e26\u4efb\u610f\u5c5e\u6027\u7684 XML<\/h4>\n<p>\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d&#xff0c;\u6211\u4eec\u7ecf\u5e38\u9700\u8981\u89e3\u6790\u5305\u542b\u4efb\u610f\u5c5e\u6027\u7684 XML\u3002\u4e0b\u9762\u7ed9\u51fa\u4e00\u4e2a\u4f7f\u7528 Java DOM \u89e3\u6790\u7684\u793a\u4f8b&#xff1a;<\/p>\n<p>import javax.xml.parsers.DocumentBuilderFactory;<br \/>\nimport org.w3c.dom.Document;<br \/>\nimport org.w3c.dom.Element;<br \/>\nimport org.w3c.dom.NamedNodeMap;<br \/>\nimport org.w3c.dom.Node;<br \/>\nimport java.io.ByteArrayInputStream;<br \/>\npublic class AnyAttributeParser {<br \/>\npublic static void main(String[] args) throws Exception {<br \/>\nString xml &#061; &#034;&lt;person name&#061;&#034;\u5f20\u4e09&#034; age&#061;&#034;30&#034; email&#061;&#034;zhangsan&#064;example.com&#034;\/&gt;&#034;;<br \/>\nDocumentBuilderFactory factory &#061; DocumentBuilderFactory.newInstance();<br \/>\nfactory.setNamespaceAware(true);<br \/>\nDocument doc &#061; factory.newDocumentBuilder()<br \/>\n.parse(new ByteArrayInputStream(xml.getBytes(&#034;UTF-8&#034;)));<br \/>\nElement root &#061; doc.getDocumentElement();<br \/>\nNamedNodeMap attrs &#061; root.getAttributes();<br \/>\nfor (int i &#061; 0; i &lt; attrs.getLength(); i&#043;&#043;) {<br \/>\nNode attr &#061; attrs.item(i);<br \/>\nSystem.out.println(&#034;\u5c5e\u6027\u540d: &#034; &#043; attr.getNodeName()<br \/>\n&#043; &#034;, \u503c: &#034; &#043; attr.getNodeValue());<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n<h4>6.3 \u6ce8\u610f\u4e8b\u9879<\/h4>\n<ul>\n<li>\u547d\u540d\u7a7a\u95f4\u51b2\u7a81&#xff1a;\u4f7f\u7528 ##other \u65f6&#xff0c;\u5982\u679c\u76ee\u6807\u547d\u540d\u7a7a\u95f4\u672c\u8eab\u6ca1\u6709\u58f0\u660e&#xff0c;\u9a8c\u8bc1\u884c\u4e3a\u53ef\u80fd\u56e0\u89e3\u6790\u5668\u800c\u5f02\u3002<\/li>\n<li>\u6027\u80fd\u5f71\u54cd&#xff1a;processContents&#061;&#034;strict&#034; \u4f1a\u663e\u8457\u589e\u52a0\u9a8c\u8bc1\u5f00\u9500&#xff0c;\u5efa\u8bae\u4ec5\u5728\u5fc5\u8981\u65f6\u4f7f\u7528\u3002<\/li>\n<li>\u53ef\u8bfb\u6027&#xff1a;\u8fc7\u5ea6\u4f7f\u7528 anyAttribute \u4f1a\u524a\u5f31 Schema \u7684\u7ea6\u675f\u80fd\u529b&#xff0c;\u5e94\u6743\u8861\u7075\u6d3b\u6027\u4e0e\u4e25\u8c28\u6027\u3002<\/li>\n<\/ul>\n<h3>7. \u603b\u7ed3<\/h3>\n<p>anyAttribute \u662f XML Schema \u4e2d\u5b9e\u73b0&#034;\u5f00\u653e\u5185\u5bb9\u6a21\u578b&#034;\u7684\u91cd\u8981\u5de5\u5177\u3002\u901a\u8fc7\u5408\u7406\u914d\u7f6e namespace \u548c processContents&#xff0c;\u4f60\u53ef\u4ee5\u5728\u4fdd\u6301 Schema \u7ea6\u675f\u529b\u7684\u540c\u65f6&#xff0c;\u4e3a XML \u6587\u6863\u9884\u7559\u7075\u6d3b\u7684\u6269\u5c55\u7a7a\u95f4\u3002\u5efa\u8bae\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u9075\u5faa\u4ee5\u4e0b\u539f\u5219&#xff1a;<\/p>\n<ul>\n<li>\u4f18\u5148\u4f7f\u7528 ##other \u6216\u5177\u4f53\u547d\u540d\u7a7a\u95f4&#xff0c;\u907f\u514d\u65e0\u9650\u5236\u7684 ##any\u3002<\/li>\n<li>\u6839\u636e\u4e1a\u52a1\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684 processContents \u7ea7\u522b\u3002<\/li>\n<li>\u5728\u6587\u6863\u4e2d\u660e\u786e\u8bb0\u5f55\u54ea\u4e9b\u5c5e\u6027\u662f&#034;\u6807\u51c6\u5c5e\u6027&#034;&#xff0c;\u54ea\u4e9b\u662f&#034;\u6269\u5c55\u5c5e\u6027&#034;\u3002<\/li>\n<\/ul>\n<p>\u638c\u63e1 anyAttribute&#xff0c;\u80fd\u8ba9\u4f60\u7684 XML Schema \u8bbe\u8ba1\u66f4\u52a0\u5065\u58ee\u548c\u7075\u6d3b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u5f15\u8a00\u5728 XML Schema \u4e2d&#xff0c;anyAttribute \u5143\u7d20\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u4f46\u5e38\u88ab\u5ffd\u89c6\u7684\u7279\u6027\u3002\u5b83\u5141\u8bb8\u4f60\u5728\u4e00\u4e2a\u590d\u6742\u7c7b\u578b\u4e2d\u58f0\u660e\\&#8221;\u4efb\u610f\u5c5e\u6027\\&#8221;&#xff0c;\u4ece\u800c\u4e3a XML \u6587\u6863\u63d0\u4f9b\u6781\u5927\u7684\u6269\u5c55\u6027\u3002\u65e0\u8bba\u662f\u5904\u7406\u7b2c\u4e09\u65b9\u6570\u636e\u3001\u6784\u5efa\u53ef\u63d2\u62d4\u7684\u914d\u7f6e\u7cfb\u7edf&#xff0c;\u8fd8\u662f\u8bbe\u8ba1\u5f00\u653e\u5f0f\u7684\u534f\u8bae\u683c\u5f0f&#xff0c;anyAttribute \u90fd\u80fd\u6d3e\u4e0a\u7528\u573a\u3002\u672c\u6587\u5c06\u7cfb\u7edf\u8bb2\u89e3 anyAttribute \u7684\u8bed\u6cd5\u3001\u5c5e\u6027\u3001\u547d\u540d\u7a7a\u95f4\u7ea6\u675f\u3001\u4e0e any \u5143\u7d20\u7684\u533a\u522b&#xff0c;\u5e76\u901a\u8fc7\u5927\u91cf\u53ef\u8fd0\u884c\u7684\u4ee3\u7801\u5b9e<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[2545],"topic":[],"class_list":["post-97819","post","type-post","status-publish","format-standard","hentry","category-server","tag-xml"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>XML Schema anyAttribute \u5143\u7d20\u8be6\u89e3\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/97819.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"XML Schema anyAttribute \u5143\u7d20\u8be6\u89e3\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"1. \u5f15\u8a00\u5728 XML Schema \u4e2d&#xff0c;anyAttribute \u5143\u7d20\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u4f46\u5e38\u88ab\u5ffd\u89c6\u7684\u7279\u6027\u3002\u5b83\u5141\u8bb8\u4f60\u5728\u4e00\u4e2a\u590d\u6742\u7c7b\u578b\u4e2d\u58f0\u660e&quot;\u4efb\u610f\u5c5e\u6027&quot;&#xff0c;\u4ece\u800c\u4e3a XML \u6587\u6863\u63d0\u4f9b\u6781\u5927\u7684\u6269\u5c55\u6027\u3002\u65e0\u8bba\u662f\u5904\u7406\u7b2c\u4e09\u65b9\u6570\u636e\u3001\u6784\u5efa\u53ef\u63d2\u62d4\u7684\u914d\u7f6e\u7cfb\u7edf&#xff0c;\u8fd8\u662f\u8bbe\u8ba1\u5f00\u653e\u5f0f\u7684\u534f\u8bae\u683c\u5f0f&#xff0c;anyAttribute \u90fd\u80fd\u6d3e\u4e0a\u7528\u573a\u3002\u672c\u6587\u5c06\u7cfb\u7edf\u8bb2\u89e3 anyAttribute \u7684\u8bed\u6cd5\u3001\u5c5e\u6027\u3001\u547d\u540d\u7a7a\u95f4\u7ea6\u675f\u3001\u4e0e any \u5143\u7d20\u7684\u533a\u522b&#xff0c;\u5e76\u901a\u8fc7\u5927\u91cf\u53ef\u8fd0\u884c\u7684\u4ee3\u7801\u5b9e\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/97819.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-30T02:16:51+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/97819.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/97819.html\",\"name\":\"XML Schema anyAttribute \u5143\u7d20\u8be6\u89e3\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-30T02:16:51+00:00\",\"dateModified\":\"2026-08-30T02:16:51+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/97819.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/97819.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/97819.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"XML Schema anyAttribute \u5143\u7d20\u8be6\u89e3\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u6218\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"XML Schema anyAttribute \u5143\u7d20\u8be6\u89e3\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/97819.html","og_locale":"zh_CN","og_type":"article","og_title":"XML Schema anyAttribute \u5143\u7d20\u8be6\u89e3\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"1. \u5f15\u8a00\u5728 XML Schema \u4e2d&#xff0c;anyAttribute \u5143\u7d20\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u4f46\u5e38\u88ab\u5ffd\u89c6\u7684\u7279\u6027\u3002\u5b83\u5141\u8bb8\u4f60\u5728\u4e00\u4e2a\u590d\u6742\u7c7b\u578b\u4e2d\u58f0\u660e\"\u4efb\u610f\u5c5e\u6027\"&#xff0c;\u4ece\u800c\u4e3a XML \u6587\u6863\u63d0\u4f9b\u6781\u5927\u7684\u6269\u5c55\u6027\u3002\u65e0\u8bba\u662f\u5904\u7406\u7b2c\u4e09\u65b9\u6570\u636e\u3001\u6784\u5efa\u53ef\u63d2\u62d4\u7684\u914d\u7f6e\u7cfb\u7edf&#xff0c;\u8fd8\u662f\u8bbe\u8ba1\u5f00\u653e\u5f0f\u7684\u534f\u8bae\u683c\u5f0f&#xff0c;anyAttribute \u90fd\u80fd\u6d3e\u4e0a\u7528\u573a\u3002\u672c\u6587\u5c06\u7cfb\u7edf\u8bb2\u89e3 anyAttribute \u7684\u8bed\u6cd5\u3001\u5c5e\u6027\u3001\u547d\u540d\u7a7a\u95f4\u7ea6\u675f\u3001\u4e0e any \u5143\u7d20\u7684\u533a\u522b&#xff0c;\u5e76\u901a\u8fc7\u5927\u91cf\u53ef\u8fd0\u884c\u7684\u4ee3\u7801\u5b9e","og_url":"https:\/\/www.wsisp.com\/helps\/97819.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-30T02:16:51+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/97819.html","url":"https:\/\/www.wsisp.com\/helps\/97819.html","name":"XML Schema anyAttribute \u5143\u7d20\u8be6\u89e3\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-30T02:16:51+00:00","dateModified":"2026-08-30T02:16:51+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/97819.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/97819.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/97819.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"XML Schema anyAttribute \u5143\u7d20\u8be6\u89e3\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u6218"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/97819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=97819"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/97819\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=97819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=97819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=97819"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=97819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}