crazysexycrazy
Technical User
Hi, i want to get a average Score from the three different User Groups, how can i do this? I know how to add and subtract but find it difficult with the id attributes... Would it be something like this?
<xsl:for-each select="//User[@id='001']">
<xsl:value-of select="UserGroups/UserGroup@code="A001" + UserGroups/UserGroup@code="A002""/> ...etc? or what? i'm kind of confused
Also i want to add All the usergroups worth elements up? how do i do that? It just trying to add with the id attribute that is confusing me
<Users>
<User id="001">
<User_Details>
<User_Name>John</User_Name>
<User_Number1>360</User_Number1>
<User_Number2>300</User_Number2>
<Difference>60</Difference>
<TotalWorth>160</TotalWorth>
</User_Details>
<UserGroups>
<UserGroup code="A001">
<Name>A1</Name>
<Score>50</Score>
<Worth>15</Worth>
</UserGroup>
<UserGroup code="A002">
<Name>A1</Name>
<Score>50</Score>
<Worth>15</Worth>
</UserGroup>
<UserGroup code="A003">
<Name>A1</Name>
<Score>50</Score>
<Worth>15</Worth>
</UserGroup>
</UserGroups>
</User>
</Users>
<xsl:for-each select="//User[@id='001']">
<xsl:value-of select="UserGroups/UserGroup@code="A001" + UserGroups/UserGroup@code="A002""/> ...etc? or what? i'm kind of confused
Also i want to add All the usergroups worth elements up? how do i do that? It just trying to add with the id attribute that is confusing me
<Users>
<User id="001">
<User_Details>
<User_Name>John</User_Name>
<User_Number1>360</User_Number1>
<User_Number2>300</User_Number2>
<Difference>60</Difference>
<TotalWorth>160</TotalWorth>
</User_Details>
<UserGroups>
<UserGroup code="A001">
<Name>A1</Name>
<Score>50</Score>
<Worth>15</Worth>
</UserGroup>
<UserGroup code="A002">
<Name>A1</Name>
<Score>50</Score>
<Worth>15</Worth>
</UserGroup>
<UserGroup code="A003">
<Name>A1</Name>
<Score>50</Score>
<Worth>15</Worth>
</UserGroup>
</UserGroups>
</User>
</Users>