XMLStarlet不会返回任何带有xpath查询输入的值

时间:2016-06-08 10:22:21

标签: xml xpath xsd xmlstarlet

我正在尝试查询给定xml文件中某个属性的值。在不同的其他测试工具中,我检查了查询并返回了预期值“OPEN”,但是尝试使用xmlstartlet命令行工具,它不起作用。它只是回归。

这是我试过的命令

xml.exe sel -N ns3=urn:de.srs.pen.virtual.request -t -v "/ns3:penrequest/attributes/attribute[@module="MobileClearance"]/@value" ..\data\DE_OJ_PortalPrint-.480328.xml

没有返回值或消息,错误代码为1表示执行错误。我使用xmlstarlet不理解的xpath命令吗?

这里是xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns3:penrequest clientid="PDiX API V4.1.4-SNAPSHOT0" creator="OJ/user001" formid="DE_OJ_PortalPrint" instanceid="TEST.OPEN.480369" lastupdate="2016-06-08T09:25:38.983Z" pageid="" patternid="" pduser="OJ/Oliver" penid="SRS-000-IJ0-B1" start="2016-06-08T11:25:29.623+02:00" stop="2016-05-18T07:52:23.534+02:00" transmission="2016-06-08T11:28:50.926+02:00" updates="2" xmlns:ns2="urn:srs.pdx.metadata" xmlns:ns3="urn:de.srs.pen.virtual.request" xmlns:ns4="urn:srs.pdx.servicelist" xmlns:ns5="urn:srs.pdx.metaxaconfig" xmlns:ns6="http://verification.ws.pen.srs.de/">
<sessions>
    <session created="2016-06-08T09:25:30.560Z" datahash="bc1684ea5cbb4e65e745a640b056b1582e0dc0fc" device="SRS-000-IJ0-3H" extended="0" finished="2016-06-08T09:25:38.923Z" firstProcessed="2016-06-08T09:25:38.923Z" lastProcessed="2016-06-08T09:25:38.953Z" lastupdate="2016-06-08T09:25:38.953Z" order="2" sourcetype="VP" user="OJ/user001"/>
    <session created="2016-06-08T09:25:29.623Z" datahash="1e75a13b5287a638c1ad1fc2c3b02c8402e47170" device="SRS-000-IJ0-3H" extended="0" finished="2016-06-08T09:25:29.623Z" firstProcessed="2016-06-08T09:25:29.623Z" lastProcessed="2016-06-08T09:25:29.733Z" lastupdate="2016-06-08T09:25:29.780Z" order="1" sourcetype="VP" user="OJ/user001"/>
</sessions>
<formfields>
    <field device="SRS-000-IJ0-3H" fieldtype="EF" fullname="textfield" group="" icrconfidence="0" icrrecognition="0" key="textfield" lastupdate="2016-06-08T09:25:38.983Z" pageid="" sessionid="2" sourcetype="VP" start="2016-06-08T09:25:30.560Z" stop="2016-06-08T11:25:38.923+02:00" updateid="2" user="OJ/user001" value="Offene Instanz">
        <details>
            <detail end="2016-06-08T11:25:38.923+02:00" lastupdate="2016-06-08T09:25:38.983Z" session="2" start="2016-06-08T09:25:30.560Z" user="OJ/user001" value="Offene Instanz"/>
        </details>
        <attributes/>
    </field>
</formfields>
<attributes>
    <attribute device="SRS-SYS-TEM-VP" lastupdate="2016-06-08T09:25:46.223Z" module="Renderer" name="engine" user="SYSTEM/system" value="TBS.RenderingThread-Renderernull"/>
    <attribute device="SRS-SYS-TEM-VP" lastupdate="2016-06-08T09:25:53.367Z" module="Renderer" name="state" user="SYSTEM/system" value="OK"/>
    <attribute device="SRS-000-IJ0-3H" lastupdate="2016-06-08T09:25:39.077Z" module="CradleASH" name="Checksum" user="OJ/user001" value="null"/>
    <attribute device="SRS-000-IJ0-3H" lastupdate="2016-06-08T09:25:29.907Z" module="MobileClearance" name="state" user="OJ/user001" value="OPEN"/>
    <attribute device="SRS-000-IJ0-3H" lastupdate="2016-06-08T09:25:39.030Z" module="CradleASH" name="ClientId" user="OJ/user001" value="V4.1.4-SNAPSHOT0192.168.102.121 - 192.168.102.121 - OJ/user001"/>
</attributes>
<attachments>
    <binary created="2016-06-08T09:25:46.613Z" device="SRS-SYS-TEM-VP" filename="virtual-bg-input.xml" lastupdate="2016-06-08T09:25:46.613Z" name="srs.vp-renderer.xml" page="1" pageidx="0" rectime="2016-06-08T09:25:46.613Z" rectimestop="2016-06-08T09:25:46.613Z" source="XX" type="application/xml" user="SYSTEM/system">
        <data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    </binary>
</attachments>

0 个答案:

没有答案