Re: Fixed Windows use case

Hi Henri,

I have skipped the groupBy name for two reason :
* it sounds like group-by in XSLT 2.0 for-each-group
* it suggest than the element will be grouped whatever the document order
is.

With
<?xml version="1.0"?>
<a>
  <b att="a" id="_1"/>
  <b att="a" id="_2"/>
  <b att="b" id="_3"/>
  <b att="a" id="_4"/>
  <b att="b" id="_5"/>
</a>

what will be the result of p:wrap(name="my:wrapper", match="a/b",
groupBy="@att") ?

1) with reorganizing the document order. I'm really doubtful about this one.
we could end up with duplicating nodes. And it seems really to cumbersome to
implement in a streaming fashion.

<?xml version="1.0"?>
<a>
  <my:wrapper>
    <b att="a" id="_1"/>
    <b att="a" id="_2"/>
    <b att="a" id="_4"/>
  </my:wrapper>
  <my:wrapper>
    <b att="b" id="_3"/>
    <b att="b" id="_5"/>
  </my:wrapper>
</a>

or this one (which groups adjacent matches)

<?xml version="1.0"?>
<a>
  <my:wrapper>
    <b att="a" id="_1"/>
    <b att="a" id="_2"/>
  </my:wrapper>
  <my:wrapper>
    <b att="b" id="_3"/>
  </my:wrapper>
  <my:wrapper>
    <b att="a" id="_4"/>
  </my:wrapper>
  <my:wrapper>
    <b att="b" id="_5"/>
  </my:wrapper>
</a>

or even worse because of whitespace between nodes (so you need to explicitly
say that text node that contains only whitespace are glutted with previous
match)

<?xml version="1.0"?>
<a>
  <my:wrapper>
    <b att="a" id="_1"/>
  </my:wrapper>
  <my:wrapper>
    <b att="a" id="_2"/>
  </my:wrapper>
  <my:wrapper>
    <b att="b" id="_3"/>
  </my:wrapper>
  <my:wrapper>
    <b att="a" id="_4"/>
  </my:wrapper>
  <my:wrapper>
    <b att="b" id="_5"/>
  </my:wrapper>
</a>

Mohamed

On 5/8/07, Henry S. Thompson <ht@inf.ed.ac.uk> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I agree in principle with the suggestion that some grouping
> functionality would be good.  I _think_ we actually discussed this a
> while back wrt p:wrap.  The MT Pipeline wrap operation takes an option
> which gives the functionality you want, which I make a lot of use of:
>
> <p:option name="groupBy" value="@attr"/>
>
> The 'groupBy' option supplies an XPath, which is evaluated wrt the
> context of the about-to-be-wrapped items, and ones with equal values
> are grouped together.
>
> I'd certainly support adding this in to our p:wrap component.
>
> ht
> - --
> Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
>                      Half-time member of W3C Team
>     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
>             Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
>                    URL: http://www.ltg.ed.ac.uk/~ht/
> [mail really from me _always_ has this .sig -- mail without it is forged
> spam]
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.6 (GNU/Linux)
>
> iD8DBQFGQCtIkjnJixAXWBoRAn4yAJ4l9fHfmogIDA7g11aiTH+TzB0uKQCfbx+X
> vB4yU23mULIUjHIAZfPm3tE=
> =Ffpu
> -----END PGP SIGNATURE-----
>



-- 
Innovimax SARL
Consulting, Training & XML Development
9, impasse des Orteaux
75020 Paris
Tel : +33 8 72 475787
Fax : +33 1 4356 1746
http://www.innovimax.fr
RCS Paris 488.018.631
SARL au capital de 10.000 €

Received on Tuesday, 8 May 2007 08:04:18 UTC