Re: [xsl] Grouping a List into A Grid Structure

Subject: Re: [xsl] Grouping a List into A Grid Structure
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Mon, 23 Jun 2008 13:06:06 +0200 (CEST)
Jeff Sese wrote:

> I'm using the data for an XML workflow in InDesign. The main idea is 
> to convert the list into a somewhat linear structure so that items  
> are group according to order in which they appeared in the original  
> list. Somewhat like a table, where there is a column for each list.

> I added a wrapper element for the grouping that i want to achieve, to
> make it clearer:

> <root>
> 	<list>
> 		<group order="1st">
> 			<item type="a">list 1 item 1</item>
> 			<item type="a">list 2 item 1</item>
> 			<item type="a">list 3 item 1</item>
> 		</group>
> 		<group order="1st">
> 			<item type="b">list 1 item 2</item>
> 			<item/>
> 			<item/>
> 		</group>
> 		<group order="1st">
> 			<item/>
> 			<item type="b">list 2 item 2</item>
> 			<item type="b">list 3 item 2</item>
> 		</group>
> 		<group order="1st">
> 			<item/>
> 			<item type="b">list 2 item 3</item>
> 			<item type="b">list 3 item 3</item>
> 		</group>
> 		<group order="1st">
> 			<item/>
> 			<item type="b">list 2 item 4</item>
> 			<item/>
> 		</group>
> 	</list>
> </root>

  I thought about that.  But I don't see how you map your original
input to this output.  Here is you original input:

    <root>
       <list>
          <item type="a">list 1 item 1</item>
          <item type="b">list 1 item 2</item>
       </list>
       <list>
          <item type="a">list 2 item 1</item>
          <item type="b">list 2 item 2</item>
          <item type="b">list 2 item 3</item>
          <item type="b">list 2 item 4</item>
       </list>
       <list>
          <item type="a">list 3 item 1</item>
          <item type="b">list 3 item 2</item>
          <item type="b">list 3 item 3</item>
       </list>
    </root>

  From that and "somewhat like a table, where there is a column for
each list", I would expect someting like:

    <root>
       <list>
          <group order="1st">
             <item type="a">list 1 item 1</item>
             <item type="a">list 2 item 1</item>
             <item type="a">list 3 item 1</item>
          </group>
          <group order="1st">
             <item type="b">list 1 item 2</item>
             <item type="b">list 2 item 2</item>
             <item type="b">list 3 item 2</item>
          </group>
          <group order="1st">
             <item/>
             <item type="b">list 2 item 3</item>
             <item type="b">list 3 item 3</item>
          </group>
          <group order="1st">
             <item/>
             <item type="b">list 2 item 4</item>
             <item/>
          </group>
       </list>
    </root>

  Did I miss something?

  Regards,

--drkm





















      _____________________________________________________________________________ 
Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr

Current Thread