tesmc
asked on
XSL: use contains to filter variable further
i have the following variable within a function which finds 2 matching records
<xsl:variable name="test" select="
//Itin/ServInfo/Serv[@Code ='ED' and @Type= 'RED'][Name/@Number =$Id]/Text"/>
I want to filter even further by matching against a value within Text.
So my function would receive this param as $DocNum
<Text>AS KK1 06L18MAR/CHAIR/ACCPT/USD20 00/100RC CCVIXXXXXXXXXXXX0001EXPXXX X 8312312270746</Text>
The $DocNum I would be filtering against is the last number included in this string. (8312312270746)
so that then variable "test" would return that entire text bc it found matching DocNum as well.
<xsl:variable name="test" select="
//Itin/ServInfo/Serv[@Code
I want to filter even further by matching against a value within Text.
So my function would receive this param as $DocNum
<Text>AS KK1 06L18MAR/CHAIR/ACCPT/USD20
The $DocNum I would be filtering against is the last number included in this string. (8312312270746)
so that then variable "test" would return that entire text bc it found matching DocNum as well.
ASKER
I used the XSLT21 solution and this returned two instances of <text>. It did not filter by DocNum
is there a way to use the "contains" function to filter?
is there a way to use the "contains" function to filter?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sorry, no bracket. DocNum is equal to 8312312270746
then the above should work
ASKER
thanks both worked.
welcome
<xsl:variable name="test" select="
//Itin/ServInfo/Serv[@Code
XSLT1 Solution
<xsl:variable name="test" select="
//Itin/ServInfo/Serv[@Code