Subject: Re: [xsl] Pattern Matching in XSl - find groups defined in one Xml in another Xml. From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 29 Aug 2012 12:29:09 -0400 |
normalize-space(' ') returns '', which (coerced to a Boolean false) fails a test.
So regex-group(1)[normalize-space(.)] returns an empty sequence when the value of regex-group(1) is an empty string or only whitespace.
Cheers, Wendell
Regarding Ken's solutions from last Wednesday (repeated below), why is it :
<xsl:analyze-string select="$thisAlarm/@equipment" regex="^{$thisGroupedAlarm/@equipment}$"> <xsl:matching-substring> <xsl:for-each select="regex-group(1)[normalize-space(.)]"> <xsl:attribute name="found-key" select="."/> </xsl:for-each> </xsl:matching-substring> </xsl:analyze-string>
rather than
<xsl:analyze-string select="$thisAlarm/@equipment" regex="^{$thisGroupedAlarm/@equipment}$"> <xsl:matching-substring> <xsl:attribute name="found-key" select="regex-group(1)"/> </xsl:matching-substring> </xsl:analyze-string>
?
What does the [normalize-space(.)] predicate do for us ?
Uncertainly, Richard.
PS. By the way, this does seem to give the right results. I'm only now getting back to looking at it and working out how it works, having had a few days off over the (UK) Bank Holiday weekend.
-- ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Pattern Matching in XSl -, Kerry, Richard | Thread | Re: [xsl] Pattern Matching in XSl -, Michael Kay |
RE: [xsl] Pattern Matching in XSl -, G. Ken Holman | Date | Re: [xsl] Pattern Matching in XSl -, Michael Kay |
Month |