I don't use XSLT very much, but need to modify our current file.

Right now, we have the following statement:

  <xsl:value-of select="if (*:PersDriverInfo/*:kait_BusinessUseInd = '1') ))then 'Y' else 'N'"/>

I am trying to modify it to look at an additional node like this:

	<xsl:value-of select="if ((*:PersDriverInfo/*:kait_BusinessUseInd = '1') or (matches(*:VehUseCd,'BU|SR')))then 'Y' else 'N'"/>

However it is not working. The second conditional statement is taken from another part of the document, so I know it's logic is sound, but it is not producing the intended result. The resulting xml node stays set to 'N'.

As I said, I do not work with this stuff often, so perhaps I am making an obvious mistake, Any help would be appreciated.


First... I'm not an XSLT expert either.

Are you using some form of ACORD XML? PersDriverInfo and VehUseCd are both part of the standard but aren't children of the same parent which might be why it works in the other part of the document but not where you are trying to use it

To get to a (grand) parent they share you need to go up a few levels..

Here are the paths to those two nodes starting with a common ancestor (PersAutoLineBusiness)

I don't know if this sytax is correct but something like...

	<xsl:value-of select="if ((*:PersDriverInfo/*:kait_BusinessUseInd = '1') or (matches(*:../VehUseCd,'BU|SR')))then 'Y' else 'N'"/>
This article has been dead for over six months. Start a new discussion instead.