Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Grouping/Sorting Problem

From: "Dimitre Novatchev" <dimitren@---.---.-->
To: NULL
Date: 10/10/2006 8:48:00 PM

> Notice above in the 5th row the first <td> contains 'Frame' and the second
> <td> has 'Htg' but it should be the reverse because the displayOrder value
> for 'Htg' is 40 and the displayOrder value for 'Frame' is 50.
>

This is what I could understand was wanted -- from your original post.

> What it looks like to me is that all the values from
> /Products/Begin_Product/Selection/Configuration_Data/Module/Category/@name
> are put in the first <td> of each row and all the values from
> /Products/Begin_Product/Selection/Performance_Data/Perf_Data/Perf_Module/Perf_Category/@name 
> are put in the second <td> > of each row.
>
> But what needs to happen is for each Selection and for each
> Configuration_Data/Module=Performance_Data/Perf_Data/Perf_Module, SORT 
> using
> @displayOrder and write the @name value left to right in two columns in a
> table.

Not quite clear.

Could you, please, try to provide a compact, unambiguous and understandable 
description of the problem?

(for example, it would be very useful to get rid of all the html markup and 
just explain the properties of the elements (cells and rows) of the table 
and how they are related to the source xml document.

Inability to do so may usually mean that the problem is not yet well 
undestood or even that the problem is incorrectly understood.


Cheers,
Dimitre Novatchev.

"Sarah_Lund" <SarahLund@d...> wrote in message 
news:E071BAC1-BA41-4B2C-B251-F91D7D363FB1@m......
> Dimitre,
> Your transformation results in the following:
> <table>
>  <tr>
>    <td>Selection 1</td>
>  </tr>
>  <tr>
>    <td>Base Unit Module</td>
>  </tr>
>  <tr>
>    <td>Unit</td>
>    <td>Elevation</td>
>  </tr>
>  <tr>
>    <td>Unit Roof</td>
>    <td>Unit Airflow</td>
>  </tr>
>  <tr>
>    <td>Frame</td>
>    <td>Htg</td>
>  </tr>
>  <tr>
>    <td>Fan Module</td>
>  </tr>
>  <tr>
>    <td>Fan Module</td>
>    <td>Airflow</td>
>  </tr>
>  <tr>
>    <td>Fan Size</td>
>    <td>AbsPower</td>
>  </tr>
> </table>
>
>
> Notice above in the 5th row the first <td> contains 'Frame' and the second
> <td> has 'Htg' but it should be the reverse because the displayOrder value
> for 'Htg' is 40 and the displayOrder value for 'Frame' is 50.
>
> What it looks like to me is that all the values from
> /Products/Begin_Product/Selection/Configuration_Data/Module/Category/@name
> are put in the first <td> of each row and all the values from
> /Products/Begin_Product/Selection/Performance_Data/Perf_Data/Perf_Module/Perf_Category/@name 
> are put in the second <td> of each row.
>
> But what needs to happen is for each Selection and for each
> Configuration_Data/Module=Performance_Data/Perf_Data/Perf_Module, SORT 
> using
> @displayOrder and write the @name value left to right in two columns in a
> table.
>
> The following gives me the correctly grouped and sorted results but in a
> single column. I need help to get it into two columns. I have tried using
> POSITION and COUNT functions but can't get it to work.
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:msxsl="urn:schemas-microsoft-com:xslt">
> <xsl:output omit-xml-declaration="yes" indent="yes"/>
> <xsl:strip-space elements="*"/>
>
> <xsl:template match="/">
>  <html>
>    <xsl:apply-templates/>
>  </html>
> </xsl:template>
>
> <xsl:template match="/">
>
> <xsl:for-each select="/Products/Begin_Product/Selection">
> <xsl:for-each select="Configuration_Data/Module">
>
> <xsl:variable name="vpMod" select
> ="//Products/Begin_Product/Selection/Performance_Data/Perf_Data/Perf_Module[@nID
> = current()/@nID]"/>
>
> <br><b><xsl:value-of select="@name"/></b></br>
> <xsl:for-each select="msxsl:node-set(Category|$vpMod//Perf_Category)">
>
> <xsl:sort select="@displayOrder" data-type="number"/>
> <br><xsl:value-of select="@name"/> - <xsl:value-of
> select="@displayOrder"/></br>
>
> </xsl:for-each>
> </xsl:for-each>
> </xsl:for-each>
>
> </xsl:template>
> </xsl:stylesheet>
>
> The xml is below in the event you don't have it from before.
> <Products>
> <Begin_Product nID="2002421">
> <Selection>
> <Selection_Number>1</Selection_Number>
> <Configuration_Data>
> <Module displayOrder="10" nID="4656" name="Base Unit Module">
> <Category displayOrder="10" nID="21" name="Unit"/>
> <Category displayOrder="50" nID="43" name="Frame"/>
> <Category displayOrder="20" nID="67" name="Unit Roof"/>
> </Module>
> <Module displayOrder="20" nID="4658" name="Fan Module">
> <Category displayOrder="10" nID="96" name="Fan Module"/>
> <Category displayOrder="20" nID="63" name="Fan Size"/>
> </Module>
> </Configuration_Data>
> <Performance_Data>
> <Perf_Data>
> <Perf_Module nID="4656" name="Base Unit Module">
> <Perf_Category displayOrder="30" nID="10" name="Unit Airflow"/>
> <Perf_Category displayOrder="10" nID="91" name="Elevation"/>
> <Perf_Category displayOrder="40" nID="13" name="Htg"/>
> </Perf_Module>
> <Perf_Module nID="4658" name="Fan Module">
> <Perf_Category displayOrder="20" nID="23" name="Airflow"/>
> <Perf_Category displayOrder="90" nID="30" name="AbsPower"/>
> </Perf_Module>
> </Perf_Data>
> </Performance_Data>
> </Selection>
> </Begin_Product>
> </Products>
>
> I hope I have explained this clearly. Thank you for all your help. 
> Regards,
> Sarah
> 




transparent
Print
Mail
Like It
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