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

Re: flat list of contents and for-each-group

Subject: Re: flat list of contents and for-each-group
From: Stanislav Pejša <standap@xxxxxxxxx>
Date: Sat, 22 Aug 2009 23:59:51 -0400
Re:  flat list of contents and for-each-group
Thanks a lot Martin.

That was indeed what I had in mind.

However, I posted an ideal scenario and forgot to mention that "Section" does not have to be in the source XML and "Part" is then a direct child of "Chapter", see coding for Chapter III. I have also simplified the mark-up for the desired output and used element with name of the component rather than placing the name of the component into attribute which is more realistic, e.g. <level01 type="chapter">.

I tried to modify your template accordingly, but I failed. I really appreciate you sent me the template it helped me a lot, but it also made me realize that I did not take into consideration some variations in the source XML. Can your template be adjusted in order to addressed this new situation?

Best regards, Standa

the expanded input:
<book>
<title>Some Title</title>
<b_part><level_name>Chapter I: Title of Chapter I</level_name></b_part>
<b_part><level_name>Section 1: Title of section 1</level_name></b_part>
<b_part><level_name>Part 1: Title of Part 1</level_name></b_part>
<b_part><level_name>Part 2: Title of Part 2</level_name></b_part>
<b_part><level_name>Part n: Title of Part n </level_name></b_part>
<b_part><level_name>Chapter II: Title of Chapter II</level_name></b_part>
<b_part><level_name>A) Title of Section A</level_name></b_part>
<b_part><level_name>A/1 Title of Part 1</level_name></b_part>
<b_part><level_name>A/n Title of Part n</level_name></b_part>
<b_part><level_name>B) Title of Section A</level_name></b_part>
<b_part><level_name>B/1 Title of Part 1</level_name></b_part>
<b_part><level_name>B/n Title of Part n</level_name></b_part>
<b_part><level_name>Chapter III: Title of Chapter III</level_name></b_part>
<b_part><level_name>III/1 Title of Part 1</level_name></b_part>
<b_part><level_name>III/2 Title of Part n</level_name></b_part>
</book>


The modified desired output


<book>
<title>Some Title</title>
<toc>
<p>paragraph</p>
<level01 type="chapter"><title>Chapter I: Title of Chapter I</title>
<level02 type="section"><title>Section 1: Title of Section 1</title>
<level03 type="part"><title>Part 1: Title of Part 1</title></level03>
<level03 type="part"><title>Part 2: Title of Part 2</title></level03>
<level03 type="part"><title>Part n: Title of Part n</title></level03>
</level02>
</level01>
<level01 type="chapter"><title>Chapter II: Title of Chapter II</title>
<level02 type="section"><title>A) Title of Section A</title>
<level03 type="part"><title>A/1 Title of Part 1</title></level03>
<level03 type="part"><title>A/n Title of Part n </title></level03>
</level02>
<level02 type="section"><title>B) Title of Section B</title>
<level03 type="part"><title>B/1 Title of Part 1</title></level03>
<level03 type="part"><title>B/n Title of Part n </title></level03>
</level02>
</level01>
<level01 type="chapter"><title>Chapter III: Title of Chapter III</title>
<level02 type="part"><title>Part 1: Title of Part 1</title></level02>
<level02 type="part"><title>Part 2: Title of Part 2</title></level02>
</level01>
</toc>
</book>

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.