繁体   English   中英

以下TIBCO表达式中的“ /”是什么意思

[英]What is the meaning of '/' in following TIBCO expression

我在Tibco业务工作模块中有以下代码

$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 https://docs.tibco.com/pub/activematrix_businessworks/6.3.0/doc/html/GUID-D319018B-AA74-428D-A034-E477778AD2B6.html

该表达式首先过滤所有具有EntOfferingCode = $ Read_DB_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:

<?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>

表达式返回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>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"

这两个示例都将返回true

如果您的问题是xslt表达式是什么意思,则基本上是在检查以下内容:

  1. 对于所有LicenseInfo / CoreEnt / Ent,
  2. 其中Ent / EntOfferingCode =数据库中的EOC值
  3. 检查相应的状态是否已禁用
  4. 如果禁用,则输出true,否则输出false。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM