Analyze-String and A Multiple-Match Example
I'm using Saxon 9b
I using XSLT 2.0 3rd ed as reference.
I have a string $keyVal = "<ABC>,<XYZ>" and I need to parse out the ABC and the XYZ. Note, that at run time I will not know how many comma separated <AAA> sets there will be. They will not all have 3 characters and they may contain Letters, Numbers and a Dash symbol. So, "<IB6F-3-4>,<IB6S-23-19>,<IFA2-3>" would be a perfectly general example. I would expect IB6F-3-4 and IB6S-23-19 and IFA2-3 to be the parsed results.
I have tried
<xsl:analyze-string select="$keyVal" regex="^.*?([A-Z0-9\-]+).*?$">
<xsl:matching-substring>
<xsl:value-of select="regex-group(1)"/>
</xsl:matching-substring>
</xsl:analyze-string>
Which very nicely parses the first item, but not the rest.
I'm reading the section in Chpt 5 called "A Multiple-Match Example" which I believe is what I need, but I'm not understanding what I'm reading. It seems that my regex should have called matching-substring for each pattern that matched Letters, Numbers and/or a Dash. But I'm only getting it called once.
What part am I missing?
Thanks.
__________________
------------------------
Keep Moving Forward
GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876
Michael Hare
|