压缩 XML

去掉源代码中多余的排版空白,输出仍是文本而非压缩文件。

输入: 文本结果: 文本

文本输入

工具选项

案例

Compact an RSS item with an ampersand entity

输入

<item>
  <title>Fish &amp; chips</title>
  <link>https://example.org/menu</link>
</item>

Expected answer

<item><title>Fish &amp; chips</title><link>https://example.org/menu</link></item>
保留注释
Off
Keep a license comment in a small SVG asset

输入

<!-- Artwork: CC0 -->
<svg xmlns="http://www.w3.org/2000/svg">
  <path d="M0 0 L10 10"/>
</svg>

Expected answer

<!-- Artwork: CC0 --><svg xmlns="http://www.w3.org/2000/svg"><path d="M0 0 L10 10"/></svg>
保留注释
On
Remove an editing note from a book catalogue

输入

<catalog>
<!-- staging note -->
<book id="alice"><title>Alice in Wonderland</title><year>1865</year></book>
</catalog>

Expected answer

<catalog><book id="alice"><title>Alice in Wonderland</title><year>1865</year></book></catalog>
保留注释
Off
Keep an XML declaration and namespaced metadata

输入

<?xml version="1.0" encoding="UTF-8"?>
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">The Starry Night</dc:title>

Expected answer

<?xml version="1.0" encoding="UTF-8"?><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">The Starry Night</dc:title>
保留注释
Off
Compact a two-point GPX route

输入

<gpx version="1.1" creator="Example" xmlns="http://www.topografix.com/GPX/1/1">
<rte>
<rtept lat="51.5" lon="-0.1"/>
<rtept lat="51.501" lon="-0.101"/>
</rte>
</gpx>

Expected answer

<gpx version="1.1" creator="Example" xmlns="http://www.topografix.com/GPX/1/1"><rte><rtept lat="51.5" lon="-0.1"/><rtept lat="51.501" lon="-0.101"/></rte></gpx>
保留注释
Off

参数

参数默认值输入与选项
保留注释false开启或关闭

相关工具

代码整理

操作参考

查看原始技术文档 (English)