|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Wrapping around textual and element node at the same t
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








