I have an XML node, which is part of a larger XML as below, which contains certain symbols in subscript.
<MT N="Abstract" V="Centre-of-mass energies in the region 142<W<sub>γp</sub><293 GeV with the ZEUS detector at HERA using an integrated luminosity"/>
I need to format the value in @V attribute, such that every < which is succeeded by an alphabet as in <W above, should be replaced as < W, with a single space between them, when parsed with an XSLT.
Is this possible? XSLT 1.0 solution preferred.
It is possible. In XSLT 2.0 it would be a doddle (with a regular expression). However, this is direct ‘what you said’ script in XSLT 1.0:
which produces what you asked for, although it acts funny with numbers and / characters.
It produces:
Obviously if you update the translate with / and 1234567890 it will handle numbers and slashes too.