[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

distinct values by xslt

Subject: distinct values by xslt
From: "JS Rawat" <jrawat@xxxxxxxxxxxxxx>
Date: Wed, 18 May 2011 18:07:32 +0530
 distinct values by xslt
Hi List,
Anyone have any idea about to find out distinct attribute value by xslt.
Figure 2 and Figure 3 are getting deleted by the logic provided by me as
shown in the below XSLT. Below are the require things
 
XSLT
<xsl:template match="p">
<p class="Para_indented">
 <xsl:apply-templates/>
</p>
  <xsl:if test="link[@type='figure']">
   <xsl:variable name="figid" select="link[@type='figure']/@rid"/>
   <xsl:if test="not(preceding::link[@type='figure'][@rid=$figid])">
    <xsl:apply-templates select="//object[@id=$figid]"/>
   </xsl:if>
  </xsl:if>
  <xsl:if test="link[@type='table']">
   <xsl:variable name="tableid" select="link[@type='table']/@rid"/>
   <xsl:if test="not(preceding::link[@type='table'][@rid=$tableid])">
    <xsl:apply-templates select="//object[@id=$tableid]"/>
   </xsl:if>
  </xsl:if>
</xsl:template>

 
Input
<p>First One of the primary goals (<link rid="f1" type="figure">Fig.
1</link>).</p>
<p>second (see <link rid="f2" type="figure">Fig. 2</link>) and thos and
<link rid="f3" type="figure">Fig. 3</link>). supporting the prediction that
these species accelerate their development at the expense of growth (<link
rid="f1" type="figure">Fig. 1</link>).</p>
 
 
Required OUTPUT
<p class="Para_Indented">First One of the primary goals (<a class="figcit"
href="#fig1">Fig. 1</a>).</p>
<div class="divFigure">
 <table class="Figure" width="100%" align="center" border="0" id="fig1">
 </table>
</div>
<p class="Para_Indented">second (see <a class="figcit" href="#fig2">Fig.
2</a>) and thos and <a class="figcit" href="#fig3">Fig. 3</a>). supporting
the prediction that these species accelerate their development at the
expense of growth (<a class="figcit" href="#fig1">Fig. 1</a>).</p>
<div class="divFigure">
 <table class="Figure" width="100%" align="center" border="0" id="fig2">
 </table>
</div>
<div class="divFigure">
 <table class="Figure" width="100%" align="center" border="0" id="fig3">
 </table>
</div>
 
CURRENT OUTPUT
<p class="Para_Indented">First One of the primary goals (<a class="figcit"
href="#fig1">Fig. 1</a>).</p>
<div class="divFigure">
 <table class="Figure" width="100%" align="center" border="0" id="fig1">
 </table>
</div>
<p class="Para_Indented">second (see <a class="figcit" href="#fig2">Fig.
2</a>) and thos and <a class="figcit" href="#fig3">Fig. 3</a>). supporting
the prediction that these species accelerate their development at the
expense of growth (<a class="figcit" href="#fig1">Fig. 1</a>).</p>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.