首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >下面的TIBCO表达式中的'/‘是什么意思

下面的TIBCO表达式中的'/‘是什么意思
EN

Stack Overflow用户
提问于 2019-09-06 03:21:12
回答 2查看 84关注 0票数 0

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

代码语言:javascript
运行
复制
$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'"是什么意思?是合乎逻辑的,还是有条件的,还是其他的?

EN

Stack Overflow用户

发布于 2019-09-06 04:18:37

整个表达式都是逻辑条件。“/”只是XPath (XML Path Language)语法中的xml schema元素分隔符。您可以从这里的https://docs.tibco.com/pub/activematrix_businessworks/6.3.0/doc/html/GUID-D319018B-AA74-428D-A034-E477778AD2B6.html开始学习tibco xpath

该表达式首先过滤所有EntOfferingCode = $Read_DB_Data/group/ROW/EOC的"Ent“节点,然后检查过滤结果中是否存在EntState =”Disabled

该表达式可以替换为

代码语言:javascript
运行
复制
  not (empty($Start/pfx:GetInformationAndPropertyDetailsResponse/pfx:LicenseInfo/pfx:CoreEnt/pfx:Ent[ pfx:EntOfferingCode= "EOC" and pfx:EntState = "Disabled"]))

例如

如果模式类似于

代码语言:javascript
运行
复制
<?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:

代码语言:javascript
运行
复制
<?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:

代码语言:javascript
运行
复制
<?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>

如果您只是使用

代码语言:javascript
运行
复制
$ES_GetInfo/root/pfx4:GetInformationAndPropertyDetailsResponse/pfx4:LicenseInfo/pfx4:CoreEnt/pfx4:Ent/pfx4:EntState = "Disabled"

它将为这两个示例返回true

票数 0
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57811811

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档