Using Apache FOP, I want to collect some info in a PDF file. The XML source has some child nodes a to e, let's say
<node>
<a>some val</a>
<b>some other val</b>
<c>more val</c>
<d>even more val</d>
<e>a last val</e>
</node>
I don't want to display all of them. a,b,c shall always be displayed but may be emtpy. The maximum amount of displayed values is 3. So, d and e are optional and must be kept in that order.
Sadly, the XML structure cannot be modified.
What is the right XSLT for that? I tried
<xsl:for-each select="child::*[name()='a' or name() = 'b' or name() = 'c' or name() = 'd' or name() = 'e'][string-length(.)>0]">
<xsl:if test="position() <= 3">
<xsl:value-of select="name()"/>
</xsl:if>
</xsl:for-each>
but that doesn't bring me an ordered list. :(