Get N characters introduction text with XSLT 1.0 from XHTML
问题 How I can get first n characters with XSLT 1.0 from XHTML? I'm trying to create introduction text for news. Everything is UTF-8 HTML entity aware ( & ), one entity = one character HTML tag aware (adds missing end tags) Input HTML is always valid If input text is over n chars add '...' to end output Input tags are restricted to: a, img, p, div, span, b, strong Example input HTML: <img src="image.jpg" alt="">text <a href="http://domain.tld">link here</a> Example output with 9 characters: <img