xsl-list
[Top] [All Lists]

Re: [xsl] analyze-string question

2012-10-26 02:12:49
I can't really help you with designing an algorithm for the problem, but perhaps we can help with the part of the question that relates to XSLT coding:

>If I do <xsl:analyze-string> on the entire preceding value (the output of a first pass), won't it atomize it (after all, what it's analyzing is a string), wiping out the internal markup? And if I try to apply <xsl:analyze-string> to the individual text nodes, the "<" and ">" aren't in the same text node. I realize that this may be simpler than it appears to me, and perhaps even much simpler, but at the moment I'm having trouble even conceptualizing the problem in a way that suggests a solution. I'd be grateful for a gentle (or even not-so-gentle) nudge in the right direction.

Generally there are two approaches to this. One is to convert the markup to text, then use analyze-string on the text, and then convert the text back to markup. The other is to convert the interesting bits of text to markup, and then use facilities like for-each-group on the markup, before converting back to text. Neither is particularly straightforward...

Michael Kay
Saxonica

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