Struggles with relationships, any help appreciated!
Here should go questions about transforming XML with XSLT and FOP.
Struggles with relationships, any help appreciated!
Hi,
I am trying to create a simple bit of navigation to put on the right of my page so there will be a link to the next article. I have got this bit right but am having trouble with the final article, where I want it to point to the first article rather than the last one. The problem is arising because I have three 'section's in my document. Therefore chapter 1 could refer to chapter 1 in either three of these sections. Each section has a title which is how I am trying to differentiate it in this code. Therefore, I am trying to find chapter 1 of the section with title 'Features'.
At the moment this code produces the title for all chapter 1's in the document. I think for it to work I need to include both '//chapter[position()=1]/title' and '../title='Features'' in the same value-of. How would I go about doing this?
Thanks
Russ
I am trying to create a simple bit of navigation to put on the right of my page so there will be a link to the next article. I have got this bit right but am having trouble with the final article, where I want it to point to the first article rather than the last one. The problem is arising because I have three 'section's in my document. Therefore chapter 1 could refer to chapter 1 in either three of these sections. Each section has a title which is how I am trying to differentiate it in this code. Therefore, I am trying to find chapter 1 of the section with title 'Features'.
Code: Select all
<xsl:template name="article_nav">
<p>
<xsl:choose>
<xsl:when test="position() = last()">
<xsl:if test="../title='Features'">
<xsl:value-of select="//chapter[position()=1]/title"/>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="following-sibling::chapter[1]/title"/>
</xsl:otherwise>
</xsl:choose>
</p>
</xsl:template>
At the moment this code produces the title for all chapter 1's in the document. I think for it to work I need to include both '//chapter[position()=1]/title' and '../title='Features'' in the same value-of. How would I go about doing this?
Thanks
Russ
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service