opf_lns.to_s.should =~ /<itemref idref="#{re01_id}"/
end
+ it "should include chunked refentries in the spine in the correct order and adjacency even when they're deeply nested" do
+ opf_lns = opf_lines('orm.book.001.xml', @filedir)
+ before_refentry_id = opf_lns.to_s.sub(/.+<item id="([^"]+)" href="apa.html".+/m, '\1')
+ re01_id = opf_lns.to_s.sub(/.+<item id="([^"]+)" href="re01.html".+/m, '\1')
+ re02_id = opf_lns.to_s.sub(/.+<item id="([^"]+)" href="re02.html".+/m, '\1')
+ opf_lns.to_s.should =~ /<itemref idref="#{before_refentry_id}"[^>]*[^<]*<itemref idref="#{re01_id}"[^>]*>[^<]*<itemref idref="#{re02_id}"/m
+ end
+
after(:all) do
FileUtils.rm_r(@tmpdir, :force => true)
end
<!-- TODO: be nice to have a idref="titlepage" here -->
<xsl:choose>
<xsl:when test="$root.is.a.chunk != '0'">
- <xsl:apply-templates select="/*|//refentry" mode="opf.spine"/>
+ <xsl:apply-templates select="/*" mode="opf.spine"/>
</xsl:when>
<xsl:otherwise>
- <xsl:apply-templates select="/*/*|//refentry" mode="opf.spine"/>
+ <xsl:apply-templates select="/*/*" mode="opf.spine"/>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="generate-id(.)"/>
</xsl:attribute>
</xsl:element>
- <xsl:apply-templates select="*" mode="opf.spine"/>
+ <xsl:apply-templates select="*|.//refentry" mode="opf.spine"/>
</xsl:if>
</xsl:template>