Linux command
xml-c14n 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Inclusive canonicalization with comments
xml c14n --with-comments [file.xml]
Inclusive canonicalization stripping comments
xml c14n --without-comments [file.xml]
Exclusive canonicalization with comments
xml c14n --exc-with-comments [file.xml]
Exclusive canonicalization without comments
xml c14n --exc-without-comments [file.xml]
Canonicalize a subset selected by an XPath expression file
xml c14n --without-comments [file.xml] [xpath.xml]
Read from stdin
cat [file.xml] | xml c14n --with-comments -
说明
xml c14n is the canonicalization sub-command of xmlstarlet. It produces a byte-stable serialization of an XML document according to the W3C Canonical XML 1.0 or Exclusive XML Canonicalization 1.0 specifications. The result is what tools must compute before generating or verifying XML Digital Signatures (XML-DSig) so that semantically equivalent documents hash to the same value. Inclusive canonicalization includes ancestor namespace declarations; exclusive canonicalization (used by SAML, WS-Security, etc.) drops them unless explicitly listed in the inclusive namespace prefix list.
FAQ
What is the xml-c14n command used for?
xml c14n is the canonicalization sub-command of xmlstarlet. It produces a byte-stable serialization of an XML document according to the W3C Canonical XML 1.0 or Exclusive XML Canonicalization 1.0 specifications. The result is what tools must compute before generating or verifying XML Digital Signatures (XML-DSig) so that semantically equivalent documents hash to the same value. Inclusive canonicalization includes ancestor namespace declarations; exclusive canonicalization (used by SAML, WS-Security, etc.) drops them unless explicitly listed in the inclusive namespace prefix list.
How do I run a basic xml-c14n example?
Run `xml c14n --with-comments [file.xml]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
Where can I find more xml-c14n examples?
This page includes 6 examples for xml-c14n, plus related commands for nearby Linux tasks.