xsl-list
[Top] [All Lists]

Re: [xsl] template match question

2010-12-10 22:13:20
Ciarán Ó Duibhín wrote:

Great, many thanks, that's exactly what I meant.

However, on trying it out, I found that any newlines and indentation
within my <block> element contribute to the string_length, so that my
<block> is no longer 1 character long when they are present.

So I would like to ask again, but this time: how to match any <block>
in which the sum of the lengths of the child <inline> elements is 1
character?  (My newlines and indentation will be outside any <inline>
element, but all the "content" is inside <inline> elements.)  Do I
need to program a loop somehow, or is there a handy function?

If you are using XPath 2.0 you can use string-length(string-join(inline,''))

-- 
Piet van Oostrum
Cochabamba. URL: http://pietvanoostrum.com/
Nu Fair Trade woonartikelen op http://www.zylja.com

--~------------------------------------------------------------------
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>