xsl-list
[Top] [All Lists]

Re: [xsl] template match question

2010-12-10 21:16:31
At 2010-12-11 02:30 +0000, Ciarán Ó Duibhín wrote:
Please excuse a specific and elementary query on XSL.

I understand how

  <xsl:template match="block[string-length(./inline)=1]">

matches any <block> element which has as child an <inline> element whose text content is one character in length.

But how can I change this to match any <block>, for which the sum of the lengths of its <inline> child elements is one character; or alternatively, any <block> the length of whose whole text content is1 character, since all the text in my <block> elements is found in child <inline> elements?

If I've understood you correctly, this is what you need:

  <xsl:template match="block[string-length(.)=1]">

The block is matched if its string length is one character.

I hope this helps.

. . . . . . . . . Ken

--
Contact us for world-wide XML consulting & instructor-led training
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
G. Ken Holman                 mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>