[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] mixed content grouping by whitespace
Hi there, I've been playing with some mixed content grouping by whitespace.B I have an input like: ==== <ab xmlns="http://www.tei-c.org/ns/1.0"> B B B <seg>foo blort wibble</seg><lb/> B B B <seg>foo-<m>blort</m> wibble</seg><lb/> B B B <seg><w>foo</w>-<m>blort</m> wibble</seg><lb/> </ab> ==== and what I want as an output is to group any whitespace separated bits of content with <w> elements, including existed child <w> and <m> ==== <ab xmlns="http://www.tei-c.org/ns/1.0"> B B B <seg><w>foo</w> <w>blort</w> <w>wibble</w></seg><lb/> B B B <seg><w>foo-<m>blort</m></w> <w>wibble</w></seg><lb/> B B B <seg><w><w>foo</w>-<m>blort</ m></w> <w>wibble</w></seg><lb/> </ab> ==== Currently I'm doing something like: ==== <xsl:for-each-group select="tei:m|tei:w|text()" group-starting-with="text()"> B B B B B B B <w> B B B B B B B <xsl:apply-templates select="current-group()"/> B B B B B B B </w> B B B </xsl:for-each-group> ==== Which, as one would expect does things like <w><w>foo</w></w><w>-<m>blort</m></w> when I would want <w><w>foo</w>-<m>blort</m></w>.B This, of course, completely understandable since that is what I'm asking it to do by group-starting-with="text()". Suggestions? -James
|
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
|