I have an XML file that I need to transform using an XSL script.
Below is an example feed. I need to extract the text in the NameLabel element, but I only need the text specifically between the first two dashes.
For example, I want the A in the string below:
NTX-A-20120131-0006
I’m not well versed in XPath, so I’m struggling to put together an expression, however I’m assuming I need to use substring-(after|before). I’m just not sure how.
Sample XML:
<NewsML>
<NewsItem>
<Identification>
<NameLabel>NTX-A-20120131-0006</NameLabel>
</Identification>
</NewsItem>
</NewsML>
Edit:
I am using xslt 1.0
1 Answer