NestorArturo
NestorArturo

Reputation: 2516

Xslt Check if next text after tag is a given char

Having this:

<a><b>Hi</b><c/><d/>Friend</a>

For this specific example, how can I reference the first char after tag "b", in this case the letter "F"?.

Upvotes: 0

Views: 88

Answers (1)

michael.hor257k
michael.hor257k

Reputation: 116959

In this specific example, the instruction:

<xsl:value-of select="substring(/a/b/following-sibling::text()[1], 1, 1)"/>

will return "F". Whether that will work for other cases is not clear.

Upvotes: 1

Related Questions