A pilcrow is useful to “force” a paragraph when it would otherwise
start with a sigil. These pilcrows may not have id’s; this should be
supported.
<when test="starts-with($source, '¶')">
<choose>
<when test="contains($source, ' ')">
<when test="starts-with($source, '¶')">
<choose>
<when test="contains($source, ' ')">
- <attribute name="id">
- <value-of select="substring-before(substring-after($source, '¶'), ' ')"/>
- </attribute>
+ <variable name="id" select="substring-before(substring-after($source, '¶'), ' ')"/>
+ <if test="$id!=''">
+ <attribute name="id">
+ <value-of select="$id"/>
+ </attribute>
+ </if>
<value-of select="substring-after($source, ' ')"/>
</when>
<otherwise>
<value-of select="substring-after($source, ' ')"/>
</when>
<otherwise>