- <variable name="paragraphs">
- <call-template name="Caudex:split">
- <with-param name="source" select="string(html:pre[@书社:parsed-by='&书社;plain.xslt'])"/>
- <with-param name="separator" select="'

'"/>
- </call-template>
- </variable>
- <for-each select="exsl:node-set($paragraphs)/*">
- <variable name="lines">
- <call-template name="Caudex:split">
- <with-param name="source" select="string()"/>
- </call-template>
- </variable>
- <variable name="linespans" select="exsl:node-set($lines)/*"/>
- <variable name="partype">
- <choose>
- <when test="not($linespans[not(starts-with(., ' ') or starts-with(., '	'))])">
- <text>blockquote</text>
- </when>
- <otherwise>
- <text>p</text>
- </otherwise>
- </choose>
- </variable>
- <if test="$linespans[normalize-space()!='']">
- <element name="html:{$partype}">
- <for-each select="$linespans">
- <if test="normalize-space()!=''">
- <value-of select="normalize-space()"/>
- <if test="following-sibling::*[normalize-space()!='']">
- <text> </text>
- </if>
- </if>
- </for-each>
- </element>
- </if>
- </for-each>