xsl-list
[Top] [All Lists]

filtering and removing duplicated info

2005-08-29 06:25:05
Hello all. I'm working with an xml defining objects, like this:

<DATA>
    <OBJECTS>
       <OBJECT class="one_class">
                <TYPE cmb1="xxx" cmb2="yyy"  ...  cmb8="zzz">
       </OBJECT>
       <OBJECT class="another_class">
                <TYPE cmb1="aaa" cmb2="asd"  ...  cmb7="jjj">
                <TYPE cmb1="bbb" cmb2="adr"  ...  cmb7="kkk">
                <TYPE cmb1="ccc" cmb2="rty"  ...  cmb7="tyr">
                <TYPE cmb1="ccc" cmb2="qwe"  ...  cmb7="qwe">
       </OBJECT>

         ...

    </OBJECTS>

</DATA>

I'm filtering for class and / or any cmbX attributes (I'm creating <OPTION>
tags with no duplicated options for a web page and only remaining options
for actual filter in all other combos):
<xsl:variable name="unfiltered_var" select="/DATA/OBJECTS/OBJECT>
<xsl:variable name="filtered_var_obj" 
select="$unfiltered_var[VEH/@cmb1=$actual_selection_in_cmb1][and
so on]/>

<xsl:variable name="filtered_var_cmb1" 
select="$unfiltered_var[(_at_)class=$actual_selection_in_class]/VEH[VEH/@cmb2=$actual_selection_in_cmb2][and
so on]/>

All the same for all combos

Now, I need remove duplicated attributes for all filtered variables. I used
keys, but doesn't work. In 
http://www.dpawson.co.uk/xsl/sect2/N2696.html#d3983e16
is all info about duplicates, but it doesn't works for me:

If I've only one OBJECT node, it works perfectly with following-sibling,
using:

<xsl:variable name="filtered_without_duplicates" 
select="$filtered_var_cmbX[not(@cmbX=following-sibling::node()/@litmotor)]"/>

<xsl:for-each select="$filtered_without_duplicates">
    <xsl:value-of select="@cmbX"/>
</xsl:for-each>

But it doesn't work when filtered_without_duplicates contains more than
1 OBJECT node. Following works properly when filtered_var_cmbX is equal
to //DATA/OBJECTS/OBJECT/TYPE (whitout filter)


How can I apply all my filters and then remove duplicated values? (I'm using
a generic MSXML parser and XSLT ver 1.0)

Thanks for all your answers.

Silverfox


Internet, Intranet y extranet.¿Quieres saber en qué se diferencian?
Toda la infomación sobre el mundo de la tecnología.

http://tecnologia.tiscali.es/




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>
  • filtering and removing duplicated info, Juan Pablo Ramïrez Pïrez <=