为xml文档添加格式以便更容易阅读
Hujiuxiang
・1 分钟阅读
为xml文档添加格式以便更容易阅读
tidy -i -xml <inputfile>
这将使输入的缩进更加易读,警告和消息不会发送到STDOUT,因此你只能使用管道创建格式化的反序列化,例如:
tidy -i -xml in.xml > out.xml
示例输出
tidy -i -xml <<EOF <first>text</first><second><sub>test></sub></second EOF No warnings or errors were found. <first>text</first> <second> <sub>test></sub> </second>