This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Grouping problem
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: "Ruggier, Mario" <Mario dot Ruggier at softplumbers dot com>
- Cc: xsl-list at lists dot mulberrytech dot com
- Date: Tue, 23 Jul 2002 16:33:12 +0100
- Subject: Re: [xsl] Grouping problem
- Organization: Jeni Tennison Consulting Ltd
- References: <6C927E5DB9915040A6EF446A431CA1A601C901@spdc01.softplumbers.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
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