|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] conditional xsl:analyze-string
We have following kinds of data, which have totally unexpected
patterns. Can anyone suggest me the conditional way to write the
regular expression. It should not delete any kind of data if it is
not matching exactly. As we have seen below that some portion of
third name is getting deleted.
Input <span class="name">Axxx B.</span> <span class="name">B. Axxx</span> <span class="name">xxx C. Dxxx</span> <span class="name">Exxx-Exxx</span> XSL <xsl:analyze-string select="." regex="([A-Z][A-Z|a-z|\-|#]+)(,)?\s+([A-Z|\.]+)+"> <au> <xsl:matching-substring> <s><xsl:value-of select="regex-group(1)"/></s> <xsl:value-of select="regex-group(2)"/><xsl:text> </xsl:text> <f><xsl:value-of select="regex-group(3)"/></f> </xsl:matching-substring> </au> </xsl:analyze-string> <xsl:analyze-string select="." regex="([A-Z|\.]+)(,)?\s+([A-Z][A-Z|a-z|\-|#]+)"> <au> <xsl:matching-substring> <f><xsl:value-of select="regex-group(1)"/></f> <xsl:value-of select="regex-group(2)"/><xsl:text> </xsl:text> <s><xsl:value-of select="regex-group(3)"/></s> </xsl:matching-substring> </au> </xsl:analyze-string> Output <au><s>Axxx</s> <f>B.</f></au> <au><f>B.</f> <s>Axxx</s></au> <au><f>C.</f> <s>Dxxx</s></au> <!--xxx is deleted--> <au/> <!-- text is deleted--> Any clue in this regard will be highly appreciable!!! ...JSR
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






