W3C home > Mailing lists > Public > xproc-dev@w3.org > July 2009

RE: Bug in Calabash? adjacent-group not working correctly in p:wrap

From: <Toman_Vojtech@emc.com>
Date: Mon, 6 Jul 2009 02:27:54 -0400
Message-ID: <6E216CCE0679B5489A61125D0EFEC78710148C1C@CORPUSMX10A.corp.emc.com>
To: <xproc-dev@w3.org>
Yes, this looks like a bug.

Regards,
Vojtech


> Consider this pipeline:
> 
> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" 
> name="myPipeline">
>     <p:input port="source">
>         <p:document href="Bookstore.xml"/>
>     </p:input>
>     <p:output port="result" />
>     
>     <p:wrap match="//Book" wrapper="Item" group-adjacent="@genre" />  
> </p:declare-step>
> 
> Notice that it wraps each <Book> in an <Item> element, and 
> groups the Books based on @genre.
> 
> Here's the input BookStore.xml:
> 
> <?xml version="1.0"?>
> <BookStore>
>     <Book genre="non-fiction">
>         <Title>My Life and Times</Title>
>         <Author>Paul McCartney</Author>
>         <Date>1998</Date>
>         <ISBN>1-56592-235-2</ISBN>
>         <Publisher>McMillin Publishing</Publisher>
>     </Book>
>     <Book genre="non-fiction">
>         <Title>Illusions The Adventures of a Reluctant Messiah</Title>
>         <Author>Richard Bach</Author>
>         <Date>1977</Date>
>         <ISBN>0-440-34319-4</ISBN>
>         <Publisher>Dell Publishing Co.</Publisher>
>     </Book>
>     <Book genre="philosophy">
>         <Title>The First and Last Freedom</Title>
>         <Author>J. Krishnamurti</Author>
>         <Date>1954</Date>
>         <ISBN>0-06-064831-7</ISBN>
>         <Publisher>Harper &amp; Row</Publisher>
>     </Book>
> </BookStore>
> 
> Here's the output that Calabash produces:
> 
> <BookStore>
>     <Item>
>         <Book genre="non-fiction">
>             <Title>My Life and Times</Title>
>             <Author>Paul McCartney</Author>
>             <Date>1998</Date>
>             <ISBN>1-56592-235-2</ISBN>
>             <Publisher>McMillin Publishing</Publisher>
>         </Book>
>         <Book genre="non-fiction">
>             <Title>Illusions The Adventures of a Reluctant 
> Messiah</Title>
>             <Author>Richard Bach</Author>
>             <Date>1977</Date>
>             <ISBN>0-440-34319-4</ISBN>
>             <Publisher>Dell Publishing Co.</Publisher>
>         </Book>
>     </Item>
>     <Book genre="philosophy">
>         <Title>The First and Last Freedom</Title>
>         <Author>J. Krishnamurti</Author>
>         <Date>1954</Date>
>         <ISBN>0-06-064831-7</ISBN>
>         <Publisher>Harper &amp; Row</Publisher>
>     </Book>
> </BookStore>
> 
> Notice that the third <Book> is not wrapped in an <Item> element. 
> 
Received on Monday, 6 July 2009 06:28:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 6 July 2009 06:28:38 GMT