简体   繁体   中英

What is the meaning of '/' in following TIBCO expression

I have following code in Tibco business works module

$ES_GetInfo/root/pfx4:GetInformationAndPropertyDetailsResponse/pfx4:LicenseInfo/pfx4:CoreEnt/pfx4:Ent
[pfx4:Ent/pfx4:EntOfferingCode = $Read_DB_Data/group/ROW/EOC]
/pfx4:EntState = "Disabled"

I can understand it is comparing "EntOfferingCode" with "EOC" , but could not get the expression "/pfx4:EntState = 'Disabled'" ?

As per the TIBCO, the whole expression returns a boolean value.

What is the meaning of "/pfx4:entState='Disabled'" . Is logical or conditional or something else?

The whole expression is logical condition. The '/' is just xml schema elements separator in XPath (XML Path Language) syntax. You can start learning tibco xpath from here https://docs.tibco.com/pub/activematrix_businessworks/6.3.0/doc/html/GUID-D319018B-AA74-428D-A034-E477778AD2B6.html

The expression first filtering all the "Ent" nodes that have EntOfferingCode = $Read_DB_Data/group/ROW/EOC then check if exists EntState = "Disabled" in filtered result

the expression can be replaced by

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

For example

if the schema is like

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

Expression return true for:

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

Expression return false for:

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

if you just use

$ES_GetInfo/root/pfx4:GetInformationAndPropertyDetailsResponse/pfx4:LicenseInfo/pfx4:CoreEnt/pfx4:Ent/pfx4:EntState = "Disabled"

it will return true for both examples

If your question is what does the xslt expression mean, it is basically checking the following:

  1. For all LicenseInfo/CoreEnt/Ent,
  2. where Ent/EntOfferingCode = EOC value from the DB
  3. check if the corresponding Enstate is Disabled or not
  4. if Disabled, output true, else output false.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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