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

filtering and removing duplicated info

Subject: filtering and removing duplicated info
From: Juan Pablo Ramïrez Pïrez <silverfox@xxxxxxxxx>
Date: Mon, 29 Aug 2005 15:25:05 +0200
xsl remove data
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[@class=$actual_selection_in_class]/VEH[VEH/@cmb2=$act
ual_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 qui se diferencian?
Toda la infomacisn sobre el mundo de la tecnologma.

http://tecnologia.tiscali.es/

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.