简体   繁体   中英

xQuery IF condition does not work properly

I am trying this condition, but it always exits through else way, could you help me? thanks

if ( $orderLine[osm:ProductSpecification/text()="X"] and osm:ExtensibleAttributes[osm:Name = "Y" or osm:Name = "Z"] and osm:NewValue/text() = "A" )
            then
                 <AccessType>X</AccessType>
            else
                 <AccessType>{$attribute/osm:NewValue/text()}</AccessType>
            )

I have solved the problem changing the filter scope:

if ( $orderLine[osm:ProductSpecification/text()="X" and osm:ExtensibleAttributes[osm:Name = "Y" or osm:Name = "Z"] and osm:NewValue/text() = "A" ]])
            then
                 <AccessType>X</AccessType>
            else
                 <AccessType>{$attribute/osm:NewValue/text()}</AccessType>
            )

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