{"id":256984,"date":"2022-12-02T09:31:00","date_gmt":"2022-12-02T01:31:00","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=256984"},"modified":"2022-11-07T08:31:23","modified_gmt":"2022-11-07T00:31:23","slug":"any-element-overview","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/any-element-overview.html","title":{"rendered":"XSD \u5143\u7d20\u6982\u8ff0"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n<any> \u5143\u7d20\u4f7f\u6211\u4eec\u6709\u80fd\u529b\u901a\u8fc7\u672a\u88ab schema \u89c4\u5b9a\u7684\u5143\u7d20\u6765\u62d3\u5c55 XML \u6587\u6863\uff01<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
<any> \u5143\u7d20<\/strong><\/div>\n

<any> \u5143\u7d20\u4f7f\u6211\u4eec\u6709\u80fd\u529b\u901a\u8fc7\u672a\u88ab schema \u89c4\u5b9a\u7684\u5143\u7d20\u6765\u62d3\u5c55 XML \u6587\u6863\uff01<\/p>\n

\u4e0b\u9762\u8fd9\u4e2a\u4f8b\u5b50\u662f\u4ece\u540d\u4e3a \"family.xsd\" \u7684 XML schema \u4e2d\u5f15\u7528\u7684\u7247\u6bb5\u3002\u5b83\u5c55\u793a\u4e86\u4e00\u4e2a\u9488\u5bf9 \"person\" \u5143\u7d20\u7684\u58f0\u660e\u3002\u901a\u8fc7\u4f7f\u7528 <any> \u5143\u7d20\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4efb\u4f55\u5143\u7d20\uff08\u5728 <lastname> \u4e4b\u540e\uff09\u6269\u5c55 \"person\" \u7684\u5185\u5bb9\uff1a<\/p>\n

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

\u73b0\u5728\uff0c\u6211\u4eec\u5e0c\u671b\u4f7f\u7528 \"children\" \u5143\u7d20\u6765\u6269\u5c55 \"person\" \u5143\u7d20\u3002\u8fd9\u6b64\u79cd\u60c5\u51b5\u4e0b\u6211\u4eec\u5c31\u53ef\u4ee5\u8fd9\u4e48\u505a\uff0c\u5373\u4f7f\u4ee5\u4e0a\u8fd9\u4e2a schema \u7684\u4f5c\u8005\u6ca1\u6709\u58f0\u660e\u4efb\u4f55 \"children\" \u5143\u7d20\u3002<\/p>\n

\u8bf7\u770b\u8fd9\u4e2a schema \u6587\u4ef6\uff0c\u540d\u4e3a \"children.xsd\"\uff1a<\/p>\n

<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n<xs:schema xmlns:xs=\"http:\/\/www.w3.org\/2001\/XMLSchema\"\r\ntargetNamespace=\"http:\/\/www.w3schools.com\"\r\nxmlns=\"http:\/\/www.w3schools.com\"\r\nelementFormDefault=\"qualified\">\r\n<xs:element name=\"children\">\r\n  <xs:complexType>\r\n    <xs:sequence>\r\n      <xs:element name=\"childname\" type=\"xs:string\"\r\n      maxOccurs=\"unbounded\"\/>\r\n    <\/xs:sequence>\r\n  <\/xs:complexType>\r\n<\/xs:element>\r\n<\/xs:schema><\/pre>\n

\u4e0b\u9762\u8fd9\u4e2a XML \u6587\u4ef6\uff08\u540d\u4e3a \"Myfamily.xml\"\uff09\uff0c\u4f7f\u7528\u4e86\u6765\u81ea\u4e24\u4e2a\u4e0d\u540c\u7684 schema \u4e2d\u7684\u6210\u5206\uff0c\"family.xsd\" \u548c \"children.xsd\"\uff1a<\/p>\n

<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n<persons xmlns=\"http:\/\/www.microsoft.com\"\r\nxmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\nxsi:schemaLocation=\"http:\/\/www.microsoft.com family.xsd\r\nhttp:\/\/www.w3schools.com children.xsd\">\r\n<person>\r\n  <firstname>Hege<\/firstname>\r\n  <lastname>Refsnes<\/lastname>\r\n  <children>\r\n    <childname>Cecilie<\/childname>\r\n  <\/children>\r\n<\/person>\r\n<person>\r\n  <firstname>Stale<\/firstname>\r\n  <lastname>Refsnes<\/lastname>\r\n<\/person>\r\n<\/persons><\/pre>\n

\u4e0a\u9762\u8fd9\u4e2a XML \u6587\u4ef6\u662f\u6709\u6548\u7684\uff0c\u8fd9\u662f\u7531\u4e8e schema \"family.xsd\" \u5141\u8bb8\u6211\u4eec\u901a\u8fc7\u5728 \"lastname\" \u5143\u7d20\u540e\u7684\u53ef\u9009\u5143\u7d20\u6765\u6269\u5c55 \"person\" \u5143\u7d20\u3002<\/p>\n

<any> \u548c \u5747\u53ef\u7528\u4e8e\u5236\u4f5c\u53ef\u6269\u5c55\u7684\u6587\u6863\uff01\u5b83\u4eec\u4f7f\u6587\u6863\u6709\u80fd\u529b\u5305\u542b\u672a\u5728\u4e3b XML schema \u4e2d\u58f0\u660e\u8fc7\u7684\u9644\u52a0\u5143\u7d20\u3002<\/anyattribute><\/p>\n","protected":false},"excerpt":{"rendered":"

<any> \u5143\u7d20\u4f7f\u6211\u4eec\u6709\u80fd\u529b\u901a\u8fc7\u672a\u88ab schema \u89c4\u5b9a\u7684\u5143\u7d20\u6765\u62d3\u5c55 XML \u6587\u6863\uff01 \u4e0b\u9762\u8fd9\u4e2a\u4f8b\u5b50 […]<\/p>\n","protected":false},"author":1481,"featured_media":256993,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-256984","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/256984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1481"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=256984"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/256984\/revisions"}],"predecessor-version":[{"id":256995,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/256984\/revisions\/256995"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/256993"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=256984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=256984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=256984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}