This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Positions
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] Positions
- From: "Tanzila Mohammad" <tmohammad at entier-solutions dot com>
- Date: Tue, 13 Nov 2001 10:10:25 -0000
- Reply-to: xsl-list at lists dot mulberrytech dot com
I have the following xsl:
<xsl:for-each select="[full path]/literal">
<xsl:sort select="./@lang" data-type="text" order="ascending"/>
----------------------------------------------------------------------
which results in the following sorted XML:
....
<literal name="number">15</literal>
<literal name="table" lang="AR">ARABIC </literal>
<literal name="table" lang="CH">CHINESE</literal>
<literal name="table" lang="EN">TABLE</literal>
<literal name="table" lang="ES"> CUADRO</literal>
<literal name="table" lang="FR">TABLEAU</literal>
......
------------------------------------------------------------------------
xsl cont...:
<fo:block text-align="start">
<xsl:if test="./@name='table'">
<xsl:value-of select="."/>
</xsl:if>
-----------------------------------------------------------------------
Output:
ARABIC
CHINESE
TABLE
CUADRO
TABLEAU
-----------------------------------------------------------------------
Problem 1: I need the positions of "CUADRO" and "TABLEAU" to be reversed
(see output below)
I have played with position() but with no success - any suggestions??
-------------------------------------------------------------------------
Problem 2:
I need the following output:
ARABIC
CHINESE
TABLE 15 <!-- Display the 15 alongside TABLE-->
CUADRO
TABLEAU
-------------------------------------------------------------------------
xsl cont...
<xsl:if test="./@lang='EN'">
<xsl:value-of
select="preceding-sibling::.[@name='number']"/>
</xsl:if>
</fo:block>
</xsl:for-each>
I am trying to get the value of the preceding sibling, where name=number,
again with no success - any suggestions?
Thanks
Tanz
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list