I have elements:
<A>11511/direction=sink</A>
<B>110/direction=src</B>
Of course there are some elements without /direction suffix that is importnat to mention.
If elements A and B contain string /direction... I want to have the value before string /direction.
If elements do not contain /direction then take regular value as usual.
What should I add in value-of clause ?
<newElementA><xsl:value-of select="A"/></newElementA>
<newElementB><xsl:value-of select="B"/></newElementB>
I tried with <xsl:value-of select="substring-before(A,'/')"/> but then values which do not have value /direction are set with value null which is not correct
I also tried this but then getting error:
<newelementA><xsl:value-of select="if (contains(A,'/'))
then substring-before(A,'/') else A"/></newelementA>
I want to have values 11511and110 in result.
Thanks
substringfunctions. Please clarify which version of XSLT you can use.