[20160608]xmllint格式化xml.txt

简介: [20160608]xmllint格式化xml.txt $  gpnptool get -o- 0tho9n/yT7+TOg3RKi7FXTANqMg=XoFD8hpkRJScvOprY56Afcsujl4UdSQfq0whrVlcDRKZ4k7+r3iGvNR...
[20160608]xmllint格式化xml.txt

$  gpnptool get -o-
<?xml version="1.0" encoding="UTF-8"?><gpnp:GPnP-Profile Version="1.0"
xmlns="http://www.grid-pnp.org/2005/11/gpnp-profile" xmlns:gpnp="http://www.grid-pnp.org/2005/11/gpnp-profile"
xmlns:orcl="http://www.oracle.com/gpnp/2005/11/gpnp-profile" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.grid-pnp.org/2005/11/gpnp-profile gpnp-profile.xsd" ProfileSequence="4"
ClusterUId="7332ecd0a54defd8bf0476778d26d8e1" ClusterName="xxxxxx"
PALocation=""><gpnp:Network-Profile><gpnp:HostNetwork id="gen" HostName="*"><gpnp:Network id="net1" IP="192.168.100.0"
Adapter="bondeth0" Use="public"/><gpnp:Network id="net2" IP="10.10.10.0" Adapter="ib0"
Use="cluster_interconnect"/><gpnp:Network id="net3" IP="10.10.10.0" Adapter="ib1"
Use="cluster_interconnect"/></gpnp:HostNetwork></gpnp:Network-Profile><orcl:CSS-Profile id="css" DiscoveryString="+asm"
LeaseDuration="400"/><orcl:ASM-Profile id="asm" DiscoveryString="o/*/*"
SPFile="+DBFS_DG/xxxxxx/asmparameterfile/registry.253.860619287"/><ds:Signature
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><ds:SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform
Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <InclusiveNamespaces
xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="gpnp orcl
xsi"/></ds:Transform></ds:Transforms><ds:DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>0tho9n/yT7+TOg3RKi7FXTANqMg=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>XoFD8hpkRJScvOprY56Afcsujl4UdSQfq0whrVlcDRKZ4k7+r3iGvNRQek8VS8rbxIgj3EKGdZxSgmI5xz7jZ+zYYkG7rEfavpCsGVjyjX78jTKlUb+SS1pl1mA9QEHRxR7evaTVsWHkFEdmSt5W6ptM9AT6I/p4+08AkZhP7C8=</ds:SignatureValue></ds:Signature></gpnp:GPnP-Profile>
Success.

--注:这里的输出实际上是一行,我格式化了.实际上使用xmllint很好格式化抽取里面的信息,例子:

$  gpnptool get -o- | xmllint --format - | grep SPFile

Success.
  <orcl:ASM-Profile id="asm" DiscoveryString="o/*/*" SPFile="+DBFS_DG/xxxxxx/asmparameterfile/registry.253.860619287"/>

$  rpm -qa | grep  libxml2
libxml2-2.6.26-2.1.21.0.1.el5_9.3
libxml2-python-2.6.26-2.1.21.0.1.el5_9.3
libxml2-2.6.26-2.1.21.0.1.el5_9.3

--具体的使用可以man xmllint查看.
目录
相关文章
|
XML 数据格式
【sublime Text】sublime Text3安装可以使xml格式化的插件
应该有机会 ,会碰到需要格式化xml文件的情况。 例如,修改word转化的xml文件之后再将修改之后的xml文件转化为word文件。 但是,word另存的xml文件是没有格式的一片:    那怎么格式化 这个巨大的xml文件的格式呢?   解决方法: 1。
5046 0
|
4月前
|
XML 数据格式
程序技术好文:格式化xml
程序技术好文:格式化xml
77 0
|
11月前
|
XML Java API
Java实现XML格式化
Java实现XML格式化
260 0
|
缓存 Java Android开发
【Android 应用开发】Android开发技巧--Application, ListView排列,格式化浮点数,string.xml占位符,动态引用图片
【Android 应用开发】Android开发技巧--Application, ListView排列,格式化浮点数,string.xml占位符,动态引用图片
285 0
【Android 应用开发】Android开发技巧--Application, ListView排列,格式化浮点数,string.xml占位符,动态引用图片
|
Android开发
【Android 应用开发】Android开发技巧--Application, ListView排列,格式化浮点数,string.xml占位符,动态引用图片(三)
【Android 应用开发】Android开发技巧--Application, ListView排列,格式化浮点数,string.xml占位符,动态引用图片(三)
128 0
【Android 应用开发】Android开发技巧--Application, ListView排列,格式化浮点数,string.xml占位符,动态引用图片(三)
|
Android开发
【Android 应用开发】Android开发技巧--Application, ListView排列,格式化浮点数,string.xml占位符,动态引用图片(二)
【Android 应用开发】Android开发技巧--Application, ListView排列,格式化浮点数,string.xml占位符,动态引用图片(二)
144 0
|
Android开发 Java 数据格式
eclipse的格式化规则(即format.xml文件)
eclipse的格式化规则(即format.xml文件) 下面是文件内容 ...
1323 0