Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xpath 什么是'/';在下面的TIBCO表达式中_Xpath_Tibco_Tibco Business Works - Fatal编程技术网

Xpath 什么是'/';在下面的TIBCO表达式中

Xpath 什么是'/';在下面的TIBCO表达式中,xpath,tibco,tibco-business-works,Xpath,Tibco,Tibco Business Works,我在Tibco business works模块中有以下代码 $ES_GetInfo/root/pfx4:GetInformationAndPropertyDetailsResponse/pfx4:LicenseInfo/pfx4:CoreEnt/pfx4:Ent [pfx4:Ent/pfx4:EntOfferingCode = $Read_DB_Data/group/ROW/EOC] /pfx4:EntState = "Disabled" 我可以理解它正在将“EntOfferingCode”

我在Tibco business works模块中有以下代码

$ES_GetInfo/root/pfx4:GetInformationAndPropertyDetailsResponse/pfx4:LicenseInfo/pfx4:CoreEnt/pfx4:Ent
[pfx4:Ent/pfx4:EntOfferingCode = $Read_DB_Data/group/ROW/EOC]
/pfx4:EntState = "Disabled"
我可以理解它正在将
“EntOfferingCode”
“EOC”
进行比较,但无法获取表达式
“/pfx4:EntState=‘Disabled’”

根据TIBCO,整个表达式返回一个布尔值


“/pfx4:entState='Disabled'”
的含义是什么。是逻辑的、有条件的还是其他的?

整个表达式是逻辑条件。“/”只是XPath(xml路径语言)语法中的xml模式元素分隔符。您可以从这里开始学习tibco xpath

表达式首先过滤所有具有EntOfferingCode=$Read\u DB\u Data/group/ROW/EOC的“Ent”节点 然后检查筛选结果中是否存在EntState=“Disabled”

表达式可以替换为

  not (empty($Start/pfx:GetInformationAndPropertyDetailsResponse/pfx:LicenseInfo/pfx:CoreEnt/pfx:Ent[ pfx:EntOfferingCode= "EOC" and pfx:EntState = "Disabled"]))
比如说

如果模式是

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
     xmlns="http://www.tibco.com/schemas/TestProcess/Schema/Schema.xsd"
     targetNamespace="http://www.tibco.com/schemas/TestProcess/Schema/Schema.xsd"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified">
    <xs:element name="GetInformationAndPropertyDetailsResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="LicenseInfo" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="LicenseInfo">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="CoreEnt" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="CoreEnt">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="Ent" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="Ent">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="EntOfferingCode" type="xs:string"/>
                <xs:element name="EntState" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

对于这两个示例,它都将返回true

如果您的问题是xslt表达式的含义是什么,它基本上是检查以下内容:

  • 对于所有LicenseInfo/Corent/Ent
  • 其中Ent/EntOfferingCode=数据库中的EOC值
  • 检查相应的Enstate是否已禁用
  • 如果禁用,则输出true,否则输出false
  • <?xml version = "1.0" encoding = "UTF-8"?>
    <GetInformationAndPropertyDetailsResponse xmlns = "http://www.tibco.com/schemas/TestProcess/Schema/Schema.xsd">
        <LicenseInfo>
            <CoreEnt>
                <Ent>
                    <EntOfferingCode>EOC</EntOfferingCode>
                    <EntState>Disabled</EntState>
                </Ent>
            </CoreEnt>
        </LicenseInfo>
    </GetInformationAndPropertyDetailsResponse>
    
    <?xml version = "1.0" encoding = "UTF-8"?>
    <GetInformationAndPropertyDetailsResponse xmlns = "http://www.tibco.com/schemas/TestProcess/Schema/Schema.xsd">
        <LicenseInfo>
            <CoreEnt>
                <Ent>
                    <EntOfferingCode>EOC</EntOfferingCode>
                    <EntState>Enabled</EntState>
                </Ent>
                <Ent>
                    <EntOfferingCode>EOC1</EntOfferingCode>
                    <EntState>Disabled</EntState>
                </Ent>
            </CoreEnt>
        </LicenseInfo>
    </GetInformationAndPropertyDetailsResponse>
    
    $ES_GetInfo/root/pfx4:GetInformationAndPropertyDetailsResponse/pfx4:LicenseInfo/pfx4:CoreEnt/pfx4:Ent/pfx4:EntState = "Disabled"