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

Adjacent grouping?

Subject: Adjacent grouping?
From: "rus tle profrustyleafiii@xxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 17 Nov 2017 17:42:34 -0000
 Adjacent grouping?
Hello All,

I am trying to remove attribute values in a list based on a frequency
parameter.

Is this possible in XSLT 2? I cannot see how to tackle the problem without
being able to store the last attribute value added to the result tree so that
I can compare against it for the following attribute values? I am told that
there is no way to query the result tree and so I am at a loss as to whether
XSLT can actually do what I require?

To illustrate, please see the example below.

The frequency parameter is 30. I would like to remove all values that are
"within 30" of the last value used. If the first value is 0 then I would like
to remove all the following attribute values that are less than 30 plus the
last value added to the result tree (in this case 0). The only way I can think
to do this is by somehow caching the last value that was copied to the result
tree so I can compare against it with the next value.

It was suggested to me that adjacent grouping my work? I am a recent beginner
to XSLT and would love to learn more about how it might help me achieve the
result I am looking for?

Thanks,

Rusty

Before:

<p frequency=b30">
    <Content value="0"/>
    <Content value=b10b/>
    <Content value=b15b/>
    <Content value=b18b/>
    <Content value=b22b/>
    <Content value=b26b/>
    <Content value=b34b/>
    <Content value=b37b/>
    <Content value=b56b/>
    <Content value=b99b/>
    <Content value=b101b/>
    <Content value="115"/>
    <Content value="118"/>
    <Content value="129"/>
</p>
After:

<p frequency="30">
    <Content value="00"/>
    <Content value=""/>
    <Content value=""/>
    <Content value=""/>
    <Content value=""/>
    <Content value=""/>
    <Content value="34"/>
    <Content value=""/>
    <Content value=""/>
    <Content value="99"/>
    <Content value=""/>
    <Content value=""/>
    <Content value=""/>
    <Content value="129"/>
</p>

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.