{"id":1141568,"date":"2025-01-08T22:32:16","date_gmt":"2025-01-08T14:32:16","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1141568.html"},"modified":"2025-01-08T22:32:19","modified_gmt":"2025-01-08T14:32:19","slug":"python%e4%b8%ad%e5%a6%82%e4%bd%95%e5%b0%86xml%e6%96%87%e4%bb%b6%e6%89%93%e5%8d%b0%e5%87%ba%e6%9d%a5","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1141568.html","title":{"rendered":"python\u4e2d\u5982\u4f55\u5c06xml\u6587\u4ef6\u6253\u5370\u51fa\u6765"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25104243\/794f0e24-652b-463b-a831-0f005d0be7ea.webp\" alt=\"python\u4e2d\u5982\u4f55\u5c06xml\u6587\u4ef6\u6253\u5370\u51fa\u6765\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5c06XML\u6587\u4ef6\u6253\u5370\u51fa\u6765\u3002\u4f7f\u7528<code>xml.etree.ElementTree<\/code>\u6a21\u5757\u3001<code>minidom<\/code>\u6a21\u5757\u3001<code>lxml<\/code>\u6a21\u5757\u7b49\u5de5\u5177\u662f\u5b9e\u73b0\u8fd9\u4e00\u529f\u80fd\u7684\u5e38\u89c1\u65b9\u6cd5\u3002<\/strong> <strong>\u8fd9\u91cc\u6211\u4eec\u4e3b\u8981\u91c7\u7528<code>xml.etree.ElementTree<\/code>\u6a21\u5757\u8fdb\u884c\u8be6\u7ec6\u8bf4\u660e\uff0c\u56e0\u4e3a\u5b83\u662fPython\u6807\u51c6\u5e93\u7684\u4e00\u90e8\u5206\uff0c\u6613\u4e8e\u4f7f\u7528\u4e14\u529f\u80fd\u5f3a\u5927\u3002<\/strong><\/p>\n<\/p>\n<p><p><code>xml.etree.ElementTree<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u4e00\u4e9b\u65b9\u4fbf\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u8f7b\u677e\u89e3\u6790\u548c\u64cd\u4f5cXML\u6570\u636e\u3002\u901a\u8fc7\u89e3\u6790XML\u6587\u4ef6\uff0c\u6211\u4eec\u53ef\u4ee5\u8bfb\u53d6\u5176\u4e2d\u7684\u5185\u5bb9\uff0c\u7136\u540e\u6253\u5370\u51fa\u6765\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u8fd9\u4e2a\u6a21\u5757\u89e3\u6790XML\u6587\u4ef6\u5e76\u6253\u5370\u5176\u5185\u5bb9\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u89e3\u6790\u548c\u6253\u5370XML\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u5728\u89e3\u6790\u548c\u6253\u5370XML\u6587\u4ef6\u65f6\uff0c\u6211\u4eec\u901a\u5e38\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u5bfc\u5165\u5fc5\u8981\u7684\u6a21\u5757<\/strong>\u3002<\/li>\n<li><strong>\u52a0\u8f7d\u5e76\u89e3\u6790XML\u6587\u4ef6<\/strong>\u3002<\/li>\n<li><strong>\u904d\u5386\u548c\u6253\u5370XML\u5185\u5bb9<\/strong>\u3002<\/li>\n<\/ol>\n<p><h4>1. \u5bfc\u5165\u5fc5\u8981\u7684\u6a21\u5757<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5bfc\u5165<code>xml.etree.ElementTree<\/code>\u6a21\u5757\u3002\u8fd9\u662f\u89e3\u6790\u548c\u64cd\u4f5cXML\u6587\u4ef6\u7684\u5173\u952e\u6a21\u5757\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import xml.etree.ElementTree as ET<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u52a0\u8f7d\u5e76\u89e3\u6790XML\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u52a0\u8f7dXML\u6587\u4ef6\u5e76\u8fdb\u884c\u89e3\u6790\u3002\u53ef\u4ee5\u4f7f\u7528<code>ElementTree<\/code>\u7c7b\u4e2d\u7684<code>parse<\/code>\u65b9\u6cd5\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">tree = ET.parse(&#39;example.xml&#39;)<\/p>\n<p>root = tree.getroot()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c<code>example.xml<\/code>\u662f\u6211\u4eec\u8981\u89e3\u6790\u7684XML\u6587\u4ef6\u3002<code>parse<\/code>\u65b9\u6cd5\u5c06\u6587\u4ef6\u89e3\u6790\u4e3a\u4e00\u4e2a<code>ElementTree<\/code>\u5bf9\u8c61\uff0c\u7136\u540e\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7<code>getroot<\/code>\u65b9\u6cd5\u83b7\u53d6\u6839\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><h4>3. \u904d\u5386\u548c\u6253\u5370XML\u5185\u5bb9<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7\u9012\u5f52\u904d\u5386XML\u6811\u7684\u5404\u4e2a\u5143\u7d20\uff0c\u53ef\u4ee5\u8f7b\u677e\u6253\u5370\u51faXML\u6587\u4ef6\u7684\u5185\u5bb9\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\u4ee3\u7801\uff0c\u7528\u4e8e\u904d\u5386\u548c\u6253\u5370XML\u6587\u4ef6\u4e2d\u7684\u6240\u6709\u5143\u7d20\u53ca\u5176\u6587\u672c\u5185\u5bb9\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def print_xml_element(element, indent=&#39;&#39;):<\/p>\n<p>    print(indent + element.tag + &quot;: &quot; + (element.text or &#39;&#39;).strip())<\/p>\n<p>    for child in element:<\/p>\n<p>        print_xml_element(child, indent + &#39;  &#39;)<\/p>\n<p>print_xml_element(root)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u51fd\u6570\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u9012\u5f52\u65b9\u5f0f\u904d\u5386\u6bcf\u4e2a\u5143\u7d20\uff0c\u5e76\u6253\u5370\u5176\u6807\u7b7e\u540d\u548c\u6587\u672c\u5185\u5bb9\u3002\u901a\u8fc7\u7f29\u8fdb\u6765\u8868\u793a\u5c42\u7ea7\u7ed3\u6784\uff0c\u4f7f\u8f93\u51fa\u7ed3\u679c\u66f4\u6613\u8bfb\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u5904\u7406XML\u6587\u4ef6\u4e2d\u7684\u5c5e\u6027<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u5143\u7d20\u548c\u6587\u672c\u5185\u5bb9\uff0cXML\u6587\u4ef6\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u8fd8\u53ef\u80fd\u5305\u542b\u5c5e\u6027\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5143\u7d20\u7684<code>attrib<\/code>\u5c5e\u6027\u8bbf\u95ee\u8fd9\u4e9b\u5c5e\u6027\uff0c\u5e76\u5c06\u5176\u6253\u5370\u51fa\u6765\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def print_xml_element_with_attributes(element, indent=&#39;&#39;):<\/p>\n<p>    attributes = &#39;, &#39;.join(f&#39;{k}=&quot;{v}&quot;&#39; for k, v in element.attrib.items())<\/p>\n<p>    print(f&quot;{indent}{element.tag} ({attributes}): &quot; + (element.text or &#39;&#39;).strip())<\/p>\n<p>    for child in element:<\/p>\n<p>        print_xml_element_with_attributes(child, indent + &#39;  &#39;)<\/p>\n<p>print_xml_element_with_attributes(root)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u683c\u5f0f\u5316\u8f93\u51faXML\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u6709\u65f6\u5019\uff0c\u76f4\u63a5\u6253\u5370XML\u6587\u4ef6\u7684\u5185\u5bb9\u5e76\u4e0d\u7f8e\u89c2\u3002\u4e3a\u4e86\u66f4\u597d\u5730\u5c55\u793aXML\u6587\u4ef6\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>xml.dom.minidom<\/code>\u6a21\u5757\u5bf9\u5176\u8fdb\u884c\u683c\u5f0f\u5316\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import xml.dom.minidom<\/p>\n<p>def pretty_print_xml(file_path):<\/p>\n<p>    tree = ET.parse(file_path)<\/p>\n<p>    xml_str = ET.tostring(tree.getroot(), encoding=&#39;unicode&#39;)<\/p>\n<p>    dom = xml.dom.minidom.parseString(xml_str)<\/p>\n<p>    pretty_xml_str = dom.toprettyxml()<\/p>\n<p>    print(pretty_xml_str)<\/p>\n<p>pretty_print_xml(&#39;example.xml&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u5c06XML\u6811\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\uff0c\u7136\u540e\u4f7f\u7528<code>minidom.parseString<\/code>\u65b9\u6cd5\u89e3\u6790\u8be5\u5b57\u7b26\u4e32\uff0c\u5e76\u901a\u8fc7<code>toprettyxml<\/code>\u65b9\u6cd5\u751f\u6210\u683c\u5f0f\u5316\u7684XML\u5b57\u7b26\u4e32\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u5904\u7406\u5927\u6587\u4ef6\u548c\u590d\u6742XML\u7ed3\u6784<\/h3>\n<\/p>\n<p><p>\u5bf9\u4e8e\u5c0f\u578b\u548c\u7b80\u5355\u7684XML\u6587\u4ef6\uff0c\u4ee5\u4e0a\u65b9\u6cd5\u975e\u5e38\u6709\u6548\u3002\u7136\u800c\uff0c\u5bf9\u4e8e\u5927\u578b\u548c\u590d\u6742\u7684XML\u6587\u4ef6\uff0c\u89e3\u6790\u548c\u6253\u5370\u53ef\u80fd\u9700\u8981\u66f4\u591a\u7684\u5185\u5b58\u548c\u5904\u7406\u65f6\u95f4\u3002\u4e3a\u6b64\uff0c\u53ef\u4ee5\u91c7\u7528\u5206\u5757\u89e3\u6790\u548c\u6d41\u5f0f\u5904\u7406\u7b49\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528<code>iterparse<\/code>\u8fdb\u884c\u5206\u5757\u89e3\u6790<\/h4>\n<\/p>\n<p><p><code>iterparse<\/code>\u65b9\u6cd5\u5141\u8bb8\u6211\u4eec\u9010\u6b65\u89e3\u6790XML\u6587\u4ef6\uff0c\u800c\u4e0d\u662f\u4e00\u6b21\u6027\u5c06\u6574\u4e2a\u6587\u4ef6\u52a0\u8f7d\u5230\u5185\u5b58\u4e2d\u3002\u8fd9\u5bf9\u4e8e\u5904\u7406\u5927\u578bXML\u6587\u4ef6\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">for event, elem in ET.iterparse(&#39;large_example.xml&#39;, events=(&#39;start&#39;, &#39;end&#39;)):<\/p>\n<p>    if event == &#39;start&#39;:<\/p>\n<p>        print(f&quot;Start element: {elem.tag}&quot;)<\/p>\n<p>    elif event == &#39;end&#39;:<\/p>\n<p>        print(f&quot;End element: {elem.tag}&quot;)<\/p>\n<p>        elem.clear()  # \u91ca\u653e\u5df2\u5904\u7406\u5143\u7d20\u7684\u5185\u5b58<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c<code>iterparse<\/code>\u65b9\u6cd5\u4f1a\u751f\u6210\u4e8b\u4ef6\u6d41\uff0c\u6211\u4eec\u53ef\u4ee5\u6839\u636e\u4e8b\u4ef6\u7c7b\u578b\uff08\u5982<code>start<\/code>\u6216<code>end<\/code>\uff09\u5bf9\u5143\u7d20\u8fdb\u884c\u5904\u7406\u3002\u901a\u8fc7\u8c03\u7528<code>clear<\/code>\u65b9\u6cd5\uff0c\u53ef\u4ee5\u91ca\u653e\u5df2\u5904\u7406\u5143\u7d20\u7684\u5185\u5b58\uff0c\u4ece\u800c\u51cf\u5c11\u5185\u5b58\u5360\u7528\u3002<\/p>\n<\/p>\n<p><h4>2. \u4f7f\u7528<code>lxml<\/code>\u6a21\u5757\u8fdb\u884c\u6d41\u5f0f\u5904\u7406<\/h4>\n<\/p>\n<p><p><code>lxml<\/code>\u6a21\u5757\u662f\u4e00\u4e2a\u529f\u80fd\u66f4\u5f3a\u5927\u7684XML\u5904\u7406\u5e93\uff0c\u652f\u6301\u66f4\u590d\u6742\u7684\u64cd\u4f5c\u3002\u5b83\u7684<code>iterparse<\/code>\u65b9\u6cd5\u4e0e<code>xml.etree.ElementTree<\/code>\u6a21\u5757\u7c7b\u4f3c\uff0c\u4f46\u529f\u80fd\u66f4\u5f3a\u5927\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from lxml import etree<\/p>\n<p>for event, elem in etree.iterparse(&#39;large_example.xml&#39;, events=(&#39;start&#39;, &#39;end&#39;)):<\/p>\n<p>    if event == &#39;start&#39;:<\/p>\n<p>        print(f&quot;Start element: {elem.tag}&quot;)<\/p>\n<p>    elif event == &#39;end&#39;:<\/p>\n<p>        print(f&quot;End element: {elem.tag}&quot;)<\/p>\n<p>        elem.clear()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\u89e3\u6790\u548c\u6253\u5370XML\u6587\u4ef6\u6709\u591a\u79cd\u65b9\u6cd5\u3002\u901a\u8fc7<code>xml.etree.ElementTree<\/code>\u6a21\u5757\uff0c\u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u5730\u52a0\u8f7d\u3001\u89e3\u6790\u548c\u6253\u5370XML\u6587\u4ef6\u7684\u5185\u5bb9\u3002\u5bf9\u4e8e\u5927\u578b\u548c\u590d\u6742\u7684XML\u6587\u4ef6\uff0c\u53ef\u4ee5\u91c7\u7528\u5206\u5757\u89e3\u6790\u548c\u6d41\u5f0f\u5904\u7406\u7684\u65b9\u6cd5\uff0c\u4ee5\u51cf\u5c11\u5185\u5b58\u5360\u7528\u5e76\u63d0\u9ad8\u5904\u7406\u6548\u7387\u3002\u6b64\u5916\uff0c\u901a\u8fc7<code>xml.dom.minidom<\/code>\u6a21\u5757\uff0c\u6211\u4eec\u53ef\u4ee5\u683c\u5f0f\u5316\u8f93\u51faXML\u6587\u4ef6\uff0c\u4f7f\u5176\u66f4\u5177\u53ef\u8bfb\u6027\u3002\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u5904\u7406\u5404\u79cdXML\u6587\u4ef6\u5e76\u6253\u5370\u5176\u5185\u5bb9\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u8bfb\u53d6\u548c\u6253\u5370XML\u6587\u4ef6\u7684\u5185\u5bb9\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684<code>xml.etree.ElementTree<\/code>\u6a21\u5757\u6765\u8bfb\u53d6\u548c\u6253\u5370XML\u6587\u4ef6\u3002\u9996\u5148\uff0c\u901a\u8fc7<code>ElementTree.parse()<\/code>\u65b9\u6cd5\u52a0\u8f7dXML\u6587\u4ef6\uff0c\u7136\u540e\u4f7f\u7528<code>ElementTree.iter()<\/code>\u904d\u5386\u6587\u4ef6\u4e2d\u7684\u5143\u7d20\uff0c\u6700\u540e\u5c06\u6bcf\u4e2a\u5143\u7d20\u7684\u6807\u7b7e\u548c\u6587\u672c\u6253\u5370\u51fa\u6765\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-python\">import xml.etree.ElementTree as ET\n\ntree = ET.parse(&#39;yourfile.xml&#39;)\nroot = tree.getroot()\n\nfor elem in root.iter():\n    print(f&#39;Tag: {elem.tag}, Text: {elem.text}&#39;)\n<\/code><\/pre>\n<p><strong>\u6253\u5370XML\u6587\u4ef6\u65f6\u5982\u4f55\u683c\u5f0f\u5316\u8f93\u51fa\u4ee5\u63d0\u9ad8\u53ef\u8bfb\u6027\uff1f<\/strong><br \/>\u5728\u6253\u5370XML\u6587\u4ef6\u5185\u5bb9\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528<code>xml.dom.minidom<\/code>\u6a21\u5757\u6765\u683c\u5f0f\u5316\u8f93\u51fa\u3002\u901a\u8fc7<code>minidom.parseString()<\/code>\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5c06XML\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u53ef\u8bfb\u7684\u683c\u5f0f\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<pre><code class=\"language-python\">from xml.dom import minidom\n\ndef pretty_print(xml_string):\n    dom = minidom.parseString(xml_string)\n    return dom.toprettyxml()\n\nwith open(&#39;yourfile.xml&#39;, &#39;r&#39;) as file:\n    xml_content = file.read()\n    print(pretty_print(xml_content))\n<\/code><\/pre>\n<p><strong>\u5728Python\u4e2d\u5904\u7406\u5927\u578bXML\u6587\u4ef6\u65f6\u6709\u4ec0\u4e48\u6280\u5de7\uff1f<\/strong><br \/>\u5bf9\u4e8e\u5927\u578bXML\u6587\u4ef6\uff0c\u4f7f\u7528<code>xml.etree.ElementTree.iterparse()<\/code>\u65b9\u6cd5\u662f\u4e00\u4e2a\u6709\u6548\u7684\u9009\u62e9\uff0c\u56e0\u4e3a\u5b83\u5141\u8bb8\u9010\u6b65\u89e3\u6790XML\u6587\u4ef6\u800c\u4e0d\u662f\u4e00\u6b21\u6027\u52a0\u8f7d\u5230\u5185\u5b58\u4e2d\u3002\u8fd9\u79cd\u65b9\u6cd5\u53ef\u4ee5\u663e\u8457\u51cf\u5c11\u5185\u5b58\u4f7f\u7528\uff0c\u63d0\u9ad8\u5904\u7406\u6548\u7387\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-python\">import xml.etree.ElementTree as ET\n\nfor event, elem in ET.iterparse(&#39;largefile.xml&#39;, events=(&#39;start&#39;, &#39;end&#39;)):\n    if event == &#39;end&#39;:\n        print(f&#39;Tag: {elem.tag}, Text: {elem.text}&#39;)\n        elem.clear()  # \u6e05\u7406\u5df2\u5904\u7406\u7684\u5143\u7d20\u4ee5\u91ca\u653e\u5185\u5b58\n<\/code><\/pre>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u8bfb\u53d6\u3001\u6253\u5370\u548c\u5904\u7406XML\u6587\u4ef6\uff0c\u6ee1\u8db3\u4e0d\u540c\u573a\u666f\u4e0b\u7684\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5c06XML\u6587\u4ef6\u6253\u5370\u51fa\u6765\u3002\u4f7f\u7528xml.etree.ElementTree\u6a21\u5757\u3001m [&hellip;]","protected":false},"author":3,"featured_media":1141579,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1141568"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1141568"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1141568\/revisions"}],"predecessor-version":[{"id":1141580,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1141568\/revisions\/1141580"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1141579"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1141568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1141568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1141568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}