Template match result to variable?
Posted: Wed Mar 10, 2021 1:26 am
Within a dita to text plugin, I'm splitting up a lenghty element using in the dita docs. The plugin then uses to break it up at those processing instructions.
What I'd like to do (and have so far failed to find a way to do) is take each result from the template "matching" and populate a variable with the result. My plugin spits out the separate "pieces", but I don't know how to take that and put it in a variable. The ultimate goal is to be able to get the string-length of each segment and determine when one is long enough that I need to force a wrap and create an indent for the wrapped segment.
It seems like this should be simple, but my many attempts have yielded an empty variable every time. Any help would be appreciated. - G
Code: Select all
<?linebreak?>
Code: Select all
<xsl:template name="lbremain" match="processing-instruction()[name() = 'linebreak']">
What I'd like to do (and have so far failed to find a way to do) is take each result from the template "matching" and populate a variable with the result. My plugin spits out the separate "pieces", but I don't know how to take that and put it in a variable. The ultimate goal is to be able to get the string-length of each segment and determine when one is long enough that I need to force a wrap and create an indent for the wrapped segment.
It seems like this should be simple, but my many attempts have yielded an empty variable every time. Any help would be appreciated. - G