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

Re: Grouping problem

Subject: Re: Grouping problem
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 23 Jul 2002 16:33:12 +0100
grouping problem complexity
Hi Mario,

> For the $offset it is rather complicated. The offset is determined
> by the structure of an LDAP string, in the XML as an attribute value
> in one of the element types. Thus, the string could be:
> "CN=one,OU=two,OU=three,DC=four,DC=five" The offset is determined by
> the number of "DC" pieces in the string (in this case 2, and which
> means I want to ignore the bottom 2 levels of the array described
> previously).
>
> I calculate this via a rather horribly complicated string split
> template, and then take a count of the number of token elements
> returned. Is there a simpler way of doing this, and that can be
> called from with key/@use ?

Hmm... Are the 'DC' pieces always the last pieces in the string? If
so, then you could take the substring after the first DC element,
strip out everything that isn't an = sign, and count how long a string
you have left:

  string-length(translate(
                  substring-after($string, 'DC'),
                  translate($string, '=', ''),
                  ''))

Otherwise, I think that what you're trying to do is of sufficient
complexity that a two-step transformation might be worthwhile. Use one
step to get the XML into a "groupable" structure, stripping out
information that isn't actually needed at the same time, and the
second step to create the groups from the data.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.