[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Axis specifers
Hi:
I have written an xslt and am having issues with axis specifiers. I will preent the sample input and xslt and explain the problem. Please let me know where I am going wrong. Sample XML: <list> <note><para>This is the first note.</para></note> <note><para>This is the second note. </para></note> <text><para>This is some text. </para></text> </list> XSLT: <xsl:template match="note"> <xsl:choose> <xsl:when test="parent::list and position()=1"> </xsl:when> <xsl:otherwise> <fo:list-block> <fo:list-item> <fo:list-item-label> <fo:block font-weight="bold">NOTE: </fo:block> </fo:list-item-label> <fo:list-item-body start-indent="body-start()" end-indent="0pt"> <fo:block> <xsl:value-of select="."/> </fo:block> </fo:list-item-body> </fo:list-item> </fo:list-block> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="note/para"> <fo:inline border-left-width="0pt" border-right-width="0pt"> <xsl:apply-templates select="node()"/> </fo:inline> </xsl:template> <!-- This is the template for list--> <xsl:template match="list"> <xsl:if test="child::note"> <xsl:apply-templates select="note" mode="list"/> </xsl:if> </xsl:template> <xsl:template match="note" mode="list"> <fo:list-block> <fo:list-item> <fo:list-item-label> <fo:block font-weight="bold">NOTE: </fo:block> </fo:list-item-label> <fo:list-item-body start-indent="body-start()" end-indent="0pt"> <fo:block> <xsl:value-of select="."/> </fo:block> </fo:list-item-body> </fo:list-item> </fo:list-block> </xsl:template> <xsl:template match="note/para" mode="list"> <fo:inline> <xsl:apply-templates select="node()" mode="list"/> </fo:inline> </xsl:template> My desired output is:
Can anyone help me resolve this issue? How can I tell the processor that after the first position of "note" check if there is another "note" element and if it is, then that should also be displayed above the text element on the output, following the first note element? So irrespective of the number of "note" elements inside the <list> element, they shoudl always be displayed above the <text> element as shown in the desired output. Please give me any ideas and suggestions. Thanks in advance for your help.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|