RE: [xsl] Empty input in analyze-string

Subject: RE: [xsl] Empty input in analyze-string
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 4 Jul 2008 14:42:20 +0100
> if para2 is an empty element, then the regex success and 
> return an empty string. How do I express in my regex that 
> empty is a non-matching regex ?

Further to Joe's response: analyze-string partitions the input string into a
sequence of substrings, passing substrings that match the regex to
xsl:matching-substring and those that don't match to
xsl:non-matching-substring. If the input is empty, there will be no
substrings, therefore no calls on either xsl:matching-substring or

If you want to test whether the string as a whole matches the regex, use the
matches() function.

Michael Kay

Current Thread