Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: To get unique attributes

From: "Oleg Tkachenko [MVP]" <oleg@--!----!---------------.--->
To: NULL
Date: 7/6/2004 12:34:00 PM
DotNetJunkies User wrote:

> I have an xml that is as follows:
> <School SchoolId="1">
>     <Classes>
>         <Class ClassId="1">
>             <Grade Section="A" Name="Robert" Percentage="85" />
>         </Class>
>         <Class ClassId="1">
>             <Class Section="B" Name="Robert" Percentage="75" />
>             <Class Section="B" Name="John" Percentage="80" />
>         </Class>
>         <Class ClassId="1">
>             <Class Section="C" Name="Robert" Percentage="87" />
>             <Class Section="C" Name="John" Percentage="85" />
>             <Class Section="C" Name="Mary" Percentage="90" />
>         </Class>
>     </Classes>
> </School>
> 
> How do I write an XSL to get the list of all students who scored 85 % (exact) ?

<xsl:for-each select="/School/Classes/Class[@Percentage='85']">
   <xsl:if test="position()!=1">, </xsl:if>
   <xsl:value-of select="@Name"/>
</xsl:for-each>

> With the node-set I get in the variable unique-Percentage, using a for loop I tried to build another XML but I am unable to get unique output.

What is exactly a uniqueness you are talking about? What should be unique?

-- 
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent