{"id":1071053,"date":"2025-01-08T11:03:47","date_gmt":"2025-01-08T03:03:47","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1071053.html"},"modified":"2025-01-08T11:03:50","modified_gmt":"2025-01-08T03:03:50","slug":"python%e5%a6%82%e4%bd%95%e6%8a%8axml%e5%8f%98%e6%88%90gb2312-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1071053.html","title":{"rendered":"python\u5982\u4f55\u628axml\u53d8\u6210gb2312"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25101636\/3473c123-984d-468e-8e93-cf352b4dd995.webp\" alt=\"python\u5982\u4f55\u628axml\u53d8\u6210gb2312\" \/><\/p>\n<p><p> <strong>\u4f7f\u7528Python\u5c06XML\u6587\u4ef6\u8f6c\u6362\u4e3aGB2312\u7f16\u7801\u7684\u6b65\u9aa4\u5305\u62ec\uff1a\u8bfb\u53d6XML\u6587\u4ef6\u3001\u8fdb\u884c\u5185\u5bb9\u89e3\u6790\u3001\u5c06\u89e3\u6790\u540e\u7684\u5185\u5bb9\u8fdb\u884c\u7f16\u7801\u8f6c\u6362\u3001\u5e76\u5c06\u8f6c\u6362\u540e\u7684\u5185\u5bb9\u4fdd\u5b58\u5230\u65b0\u7684XML\u6587\u4ef6\u4e2d\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Python\u7684\u5185\u7f6e\u6a21\u5757\u548c\u5e93\u5982<code>xml.etree.ElementTree<\/code>\u3001<code>io<\/code>\u3001<code>codecs<\/code>\u6765\u5b9e\u73b0\u8fd9\u4e2a\u8fc7\u7a0b\u3002\u63a5\u4e0b\u6765\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u8fdb\u884c\u8fd9\u4e9b\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u8bfb\u53d6\u548c\u89e3\u6790XML\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u8bfb\u53d6\u5e76\u89e3\u6790XML\u6587\u4ef6\u3002Python\u7684<code>xml.etree.ElementTree<\/code>\u6a21\u5757\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u5e93\uff0c\u9002\u7528\u4e8e\u5904\u7406XML\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import xml.etree.ElementTree as ET<\/p>\n<h2><strong>\u8bfb\u53d6XML\u6587\u4ef6<\/strong><\/h2>\n<p>tree = ET.parse(&#39;input.xml&#39;)<\/p>\n<p>root = tree.getroot()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f7f\u7528<code>ET.parse<\/code>\u65b9\u6cd5\u8bfb\u53d6XML\u6587\u4ef6\uff0c\u5e76\u4f7f\u7528<code>getroot<\/code>\u65b9\u6cd5\u83b7\u53d6XML\u7684\u6839\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u5c06\u89e3\u6790\u540e\u7684\u5185\u5bb9\u7f16\u7801\u8f6c\u6362\u4e3aGB2312<\/h3>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u5c06\u89e3\u6790\u540e\u7684\u5185\u5bb9\u8f6c\u6362\u4e3aGB2312\u7f16\u7801\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Python\u7684<code>codecs<\/code>\u6a21\u5757\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import codecs<\/p>\n<h2><strong>\u5c06XML\u5185\u5bb9\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32<\/strong><\/h2>\n<p>xml_str = ET.tostring(root, encoding=&#39;utf-8&#39;).decode(&#39;utf-8&#39;)<\/p>\n<h2><strong>\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3aGB2312\u7f16\u7801<\/strong><\/h2>\n<p>xml_gb2312 = xml_str.encode(&#39;gb2312&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u9996\u5148\u5c06XML\u5185\u5bb9\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\uff0c\u7136\u540e\u5c06\u5b57\u7b26\u4e32\u7f16\u7801\u4e3aGB2312\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u5c06\u8f6c\u6362\u540e\u7684\u5185\u5bb9\u4fdd\u5b58\u5230\u65b0\u7684XML\u6587\u4ef6\u4e2d<\/h3>\n<\/p>\n<p><p>\u6700\u540e\uff0c\u6211\u4eec\u9700\u8981\u5c06\u8f6c\u6362\u540e\u7684\u5185\u5bb9\u4fdd\u5b58\u5230\u65b0\u7684XML\u6587\u4ef6\u4e2d\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>codecs.open<\/code>\u65b9\u6cd5\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5c06\u8f6c\u6362\u540e\u7684\u5185\u5bb9\u4fdd\u5b58\u5230\u65b0\u7684XML\u6587\u4ef6\u4e2d<\/p>\n<p>with codecs.open(&#39;output.xml&#39;, &#39;w&#39;, encoding=&#39;gb2312&#39;) as f:<\/p>\n<p>    f.write(xml_gb2312.decode(&#39;gb2312&#39;))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f7f\u7528<code>codecs.open<\/code>\u65b9\u6cd5\u6253\u5f00\u4e00\u4e2a\u6587\u4ef6\uff0c\u5e76\u5c06\u8f6c\u6362\u540e\u7684\u5185\u5bb9\u5199\u5165\u6587\u4ef6\u4e2d\u3002<\/p>\n<\/p>\n<p><h3>\u5b8c\u6574\u4ee3\u7801\u793a\u4f8b<\/h3>\n<\/p>\n<p><pre><code class=\"language-python\">import xml.etree.ElementTree as ET<\/p>\n<p>import codecs<\/p>\n<h2><strong>\u8bfb\u53d6XML\u6587\u4ef6<\/strong><\/h2>\n<p>tree = ET.parse(&#39;input.xml&#39;)<\/p>\n<p>root = tree.getroot()<\/p>\n<h2><strong>\u5c06XML\u5185\u5bb9\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32<\/strong><\/h2>\n<p>xml_str = ET.tostring(root, encoding=&#39;utf-8&#39;).decode(&#39;utf-8&#39;)<\/p>\n<h2><strong>\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3aGB2312\u7f16\u7801<\/strong><\/h2>\n<p>xml_gb2312 = xml_str.encode(&#39;gb2312&#39;)<\/p>\n<h2><strong>\u5c06\u8f6c\u6362\u540e\u7684\u5185\u5bb9\u4fdd\u5b58\u5230\u65b0\u7684XML\u6587\u4ef6\u4e2d<\/strong><\/h2>\n<p>with codecs.open(&#39;output.xml&#39;, &#39;w&#39;, encoding=&#39;gb2312&#39;) as f:<\/p>\n<p>    f.write(xml_gb2312.decode(&#39;gb2312&#39;))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u5904\u7406XML\u6587\u4ef6\u4e2d\u7684\u7279\u6b8a\u5b57\u7b26<\/h3>\n<\/p>\n<p><p>\u5728\u5904\u7406XML\u6587\u4ef6\u65f6\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u7279\u6b8a\u5b57\u7b26\uff08\u5982<code>&amp;<\/code>\u3001<code>&lt;<\/code>\u3001<code>&gt;<\/code>\u7b49\uff09\uff0c\u8fd9\u4e9b\u5b57\u7b26\u9700\u8981\u8fdb\u884c\u7279\u6b8a\u5904\u7406\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>xml.sax.saxutils<\/code>\u6a21\u5757\u4e2d\u7684<code>escape<\/code>\u51fd\u6570\u6765\u8f6c\u4e49\u8fd9\u4e9b\u7279\u6b8a\u5b57\u7b26\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from xml.sax.saxutils import escape<\/p>\n<h2><strong>\u5c06XML\u5185\u5bb9\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u5e76\u8f6c\u4e49\u7279\u6b8a\u5b57\u7b26<\/strong><\/h2>\n<p>xml_str = ET.tostring(root, encoding=&#39;utf-8&#39;).decode(&#39;utf-8&#39;)<\/p>\n<p>xml_str = escape(xml_str)<\/p>\n<h2><strong>\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3aGB2312\u7f16\u7801<\/strong><\/h2>\n<p>xml_gb2312 = xml_str.encode(&#39;gb2312&#39;)<\/p>\n<h2><strong>\u5c06\u8f6c\u6362\u540e\u7684\u5185\u5bb9\u4fdd\u5b58\u5230\u65b0\u7684XML\u6587\u4ef6\u4e2d<\/strong><\/h2>\n<p>with codecs.open(&#39;output.xml&#39;, &#39;w&#39;, encoding=&#39;gb2312&#39;) as f:<\/p>\n<p>    f.write(xml_gb2312.decode(&#39;gb2312&#39;))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u4f7f\u7528BeautifulSoup\u5904\u7406XML\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u9664\u4e86<code>xml.etree.ElementTree<\/code>\u6a21\u5757\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528<code>BeautifulSoup<\/code>\u5e93\u6765\u5904\u7406XML\u6587\u4ef6\u3002<code>BeautifulSoup<\/code>\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u5e93\uff0c\u9002\u7528\u4e8e\u5904\u7406\u590d\u6742\u7684XML\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from bs4 import BeautifulSoup<\/p>\n<p>import codecs<\/p>\n<h2><strong>\u8bfb\u53d6XML\u6587\u4ef6<\/strong><\/h2>\n<p>with open(&#39;input.xml&#39;, &#39;r&#39;, encoding=&#39;utf-8&#39;) as f:<\/p>\n<p>    xml_str = f.read()<\/p>\n<h2><strong>\u89e3\u6790XML\u6587\u4ef6<\/strong><\/h2>\n<p>soup = BeautifulSoup(xml_str, &#39;xml&#39;)<\/p>\n<h2><strong>\u5c06\u89e3\u6790\u540e\u7684\u5185\u5bb9\u8f6c\u6362\u4e3aGB2312\u7f16\u7801<\/strong><\/h2>\n<p>xml_gb2312 = soup.prettify().encode(&#39;gb2312&#39;)<\/p>\n<h2><strong>\u5c06\u8f6c\u6362\u540e\u7684\u5185\u5bb9\u4fdd\u5b58\u5230\u65b0\u7684XML\u6587\u4ef6\u4e2d<\/strong><\/h2>\n<p>with codecs.open(&#39;output.xml&#39;, &#39;w&#39;, encoding=&#39;gb2312&#39;) as f:<\/p>\n<p>    f.write(xml_gb2312.decode(&#39;gb2312&#39;))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u9996\u5148\u4f7f\u7528<code>BeautifulSoup<\/code>\u5e93\u89e3\u6790XML\u6587\u4ef6\uff0c\u7136\u540e\u5c06\u89e3\u6790\u540e\u7684\u5185\u5bb9\u8f6c\u6362\u4e3aGB2312\u7f16\u7801\uff0c\u6700\u540e\u5c06\u8f6c\u6362\u540e\u7684\u5185\u5bb9\u4fdd\u5b58\u5230\u65b0\u7684XML\u6587\u4ef6\u4e2d\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528Python\u5c06XML\u6587\u4ef6\u8f6c\u6362\u4e3aGB2312\u7f16\u7801\u7684\u8fc7\u7a0b\u5305\u62ec\uff1a\u8bfb\u53d6\u548c\u89e3\u6790XML\u6587\u4ef6\u3001\u5c06\u89e3\u6790\u540e\u7684\u5185\u5bb9\u8fdb\u884c\u7f16\u7801\u8f6c\u6362\u3001\u5e76\u5c06\u8f6c\u6362\u540e\u7684\u5185\u5bb9\u4fdd\u5b58\u5230\u65b0\u7684XML\u6587\u4ef6\u4e2d\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Python\u7684\u5185\u7f6e\u6a21\u5757\u548c\u5e93\u5982<code>xml.etree.ElementTree<\/code>\u3001<code>BeautifulSoup<\/code>\u3001<code>codecs<\/code>\u6765\u5b9e\u73b0\u8fd9\u4e2a\u8fc7\u7a0b\u3002\u5728\u5904\u7406XML\u6587\u4ef6\u4e2d\u7684\u7279\u6b8a\u5b57\u7b26\u65f6\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528<code>xml.sax.saxutils<\/code>\u6a21\u5757\u4e2d\u7684<code>escape<\/code>\u51fd\u6570\u8fdb\u884c\u5904\u7406\u3002\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u5730\u5c06XML\u6587\u4ef6\u8f6c\u6362\u4e3aGB2312\u7f16\u7801\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5c06XML\u6587\u4ef6\u8f6c\u6362\u4e3aGB2312\u7f16\u7801\uff1f<\/strong><br \/>\u8981\u5c06XML\u6587\u4ef6\u8f6c\u6362\u4e3aGB2312\u7f16\u7801\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u7684\u6807\u51c6\u5e93<code>xml.etree.ElementTree<\/code>\u6765\u89e3\u6790XML\u6587\u4ef6\uff0c\u7136\u540e\u4f7f\u7528<code>open<\/code>\u51fd\u6570\u4ee5GB2312\u7f16\u7801\u91cd\u65b0\u5199\u5165\u6587\u4ef6\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\u4ee3\u7801\uff1a  <\/p>\n<pre><code class=\"language-python\">import xml.etree.ElementTree as ET\n\n# \u89e3\u6790XML\u6587\u4ef6\ntree = ET.parse(&#39;input.xml&#39;)\nroot = tree.getroot()\n\n# \u5c06XML\u5185\u5bb9\u5199\u5165\u65b0\u7684GB2312\u7f16\u7801\u6587\u4ef6\nwith open(&#39;output.xml&#39;, &#39;w&#39;, encoding=&#39;gb2312&#39;) as f:\n    f.write(ET.tostring(root, encoding=&#39;unicode&#39;))\n<\/code><\/pre>\n<p>\u8fd9\u4e2a\u793a\u4f8b\u5c06\u8bfb\u53d6\u4e00\u4e2a\u540d\u4e3a<code>input.xml<\/code>\u7684\u6587\u4ef6\uff0c\u5e76\u5c06\u5176\u8f6c\u6362\u4e3aGB2312\u7f16\u7801\u540e\u4fdd\u5b58\u4e3a<code>output.xml<\/code>\u3002<\/p>\n<p><strong>\u5728\u8f6c\u6362\u8fc7\u7a0b\u4e2d\u5982\u4f55\u5904\u7406XML\u4e2d\u7684\u7279\u6b8a\u5b57\u7b26\uff1f<\/strong><br \/>\u5728\u5c06XML\u6587\u4ef6\u8f6c\u6362\u4e3aGB2312\u7f16\u7801\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u7279\u6b8a\u5b57\u7b26\uff08\u5982\u4e2d\u6587\u5b57\u7b26\uff09\u7684\u95ee\u9898\u3002\u8fd9\u4e9b\u5b57\u7b26\u53ef\u80fd\u65e0\u6cd5\u5728GB2312\u7f16\u7801\u4e2d\u6b63\u786e\u8868\u793a\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u53ef\u4ee5\u5728\u8bfb\u53d6\u548c\u5199\u5165\u8fc7\u7a0b\u4e2d\u4f7f\u7528<code>html<\/code>\u5e93\u7684<code>escape<\/code>\u65b9\u6cd5\u6765\u8f6c\u4e49\u8fd9\u4e9b\u7279\u6b8a\u5b57\u7b26\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">import xml.etree.ElementTree as ET\nimport html\n\n# \u89e3\u6790XML\u6587\u4ef6\ntree = ET.parse(&#39;input.xml&#39;)\nroot = tree.getroot()\n\n# \u8f6c\u4e49\u7279\u6b8a\u5b57\u7b26\u5e76\u5199\u5165GB2312\u7f16\u7801\u6587\u4ef6\nwith open(&#39;output.xml&#39;, &#39;w&#39;, encoding=&#39;gb2312&#39;) as f:\n    f.write(html.escape(ET.tostring(root, encoding=&#39;unicode&#39;)))\n<\/code><\/pre>\n<p>\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u5728\u8f6c\u6362\u8fc7\u7a0b\u4e2d\u4e0d\u4f1a\u4e22\u5931\u4efb\u4f55\u91cd\u8981\u4fe1\u606f\u3002<\/p>\n<p><strong>\u4f7f\u7528Python\u7684\u5176\u4ed6\u5e93\u8f6c\u6362XML\u7f16\u7801\u6709\u4ec0\u4e48\u4f18\u52bf\uff1f<\/strong><br \/>\u9664\u4e86<code>xml.etree.ElementTree<\/code>\u5916\uff0c\u4f7f\u7528\u5176\u4ed6\u5e93\u5982<code>lxml<\/code>\u6216<code>BeautifulSoup<\/code>\u4e5f\u80fd\u8fdb\u884cXML\u7f16\u7801\u8f6c\u6362\u3002\u8fd9\u4e9b\u5e93\u901a\u5e38\u63d0\u4f9b\u66f4\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u6bd4\u5982\u66f4\u597d\u7684\u89e3\u6790\u6027\u80fd\u548c\u66f4\u591a\u7684\u5904\u7406\u9009\u9879\u3002\u4f7f\u7528<code>lxml<\/code>\u7684\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a  <\/p>\n<pre><code class=\"language-python\">from lxml import etree\n\n# \u8bfb\u53d6XML\u6587\u4ef6\nwith open(&#39;input.xml&#39;, &#39;rb&#39;) as f:\n    content = f.read()\n\n# \u89e3\u6790\u5e76\u8f6c\u6362\u7f16\u7801\nroot = etree.fromstring(content)\nwith open(&#39;output.xml&#39;, &#39;wb&#39;) as f:\n    f.write(etree.tostring(root, encoding=&#39;gb2312&#39;, xml_declaration=True))\n<\/code><\/pre>\n<p>\u9009\u62e9\u5408\u9002\u7684\u5e93\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7684\u7075\u6d3b\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u5c06XML\u6587\u4ef6\u8f6c\u6362\u4e3aGB2312\u7f16\u7801\u7684\u6b65\u9aa4\u5305\u62ec\uff1a\u8bfb\u53d6XML\u6587\u4ef6\u3001\u8fdb\u884c\u5185\u5bb9\u89e3\u6790\u3001\u5c06\u89e3\u6790\u540e\u7684\u5185\u5bb9\u8fdb\u884c [&hellip;]","protected":false},"author":3,"featured_media":1071061,"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\/1071053"}],"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=1071053"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1071053\/revisions"}],"predecessor-version":[{"id":1071062,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1071053\/revisions\/1071062"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1071061"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1071053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1071053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1071053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}