[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Mixed content, separation

Subject: Re: Mixed content, separation
From: Geert Bormans <geert@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 29 Feb 2012 09:48:40 +0100
Re:  Mixed content
Hi Dave,

You could use grouping with adjacent

<xsl:template match="p">
<xsl:for-each-group select="node()" group-adjacent="if(self::ul | self::dl) then(generate-id()) else('inline')">
<xsl:choose>
<xsl:when test="current-grouping-key() = 'inline'">
<p>
<xsl:apply-templates select="current-group()"/>
</p>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="current-group()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each-group>
</xsl:template>


    <xsl:template match="node()">
        <xsl:copy>
            <xsl:copy-of select="@*"></xsl:copy-of>
            <xsl:apply-templates select="node()"></xsl:apply-templates>
        </xsl:copy>
    </xsl:template>

since you don't know what the inlines are, I hope you know what the block elements are
you can make the test for block better yourself I guess




At 09:37 29/02/2012, you wrote:
given
<p> text1 <i>italic</i>
<ul>
...
</ul>
text 2</p>
or
<p> text1 <i>italic</i>
<dl>
...
</dl>
text 2</p>

How can I produce

<p> text1 <i>italic</i></p>
<ul>
...
</ul>
<p>text 2 (any other inlines)</p>

I.e. isolate the block elements...

nasty side:
   I'm unsure of the list of inline elements!

any suggestions appreciated.

Dave

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.