Dear All,
I am trying to wrap around words in a paragraph which looks like this.
<text><p><gliph>T</gliph>his is a very short
parapraph.<gliph>I</gliph>t is also tricky. </p> </text>
The result what I would like, should look like this.
<text>
<p>
<seg><gliph>T</gliph>his</seg>
<seg>is</seg>
<seg>a</seg>
<seg>very</seg>
<seg>short</seg>
<seg>parapraph.</seg>
<seg><gliph>I</gliph>t </seg>
<seg>is</seg>
<seg>also</seg>
<seg>tricky.</seg>
</p>
</text>
For wrapping around all words I use this template.
<xsl:template match="text/p/text()">
<xsl:analyze-string select="." regex="\w+">
<xsl:matching-substring>
<seg ><xsl:value-of select="."/></seg>
</xsl:matching-substring>
<xsl:non-matching-substring>
<xsl:value-of select="."/>
</xsl:non-matching-substring>
</xsl:analyze-string>
</xsl:template>
However, this template wraps around only the textual nodes but cannot do this:
<seg><gliph>T</gliph>his</seg>.
Is there any way to wrap around a textual node and an element node together?
Or should I do the wrapping first and then moving the gliph element later?
Thanks,
Gabor
--~------------------------------------------------------------------
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>
--~--