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

Achieving a nesting rule...?

Subject: Achieving a nesting rule...?
From: "Clifford, Karen" <Karen.Clifford@xxxxxxxxxxxx>
Date: Mon, 13 Jan 2003 15:00:56 -0000
nesting tbody
Hi there, 

Im hoping someone out there can provide me with some insight into the
following...

I have an xml doc resembling something like......

<list ordinal="Process">
				<listitem>
					<para>Some Paragraph</para>
					<list>
						<listitem>
							<list>
								<listitem>
	
<para>some paragraph</para>
	
<table>
	
<tgroup>
	
<tbody>
	
<row>
	
<entry>
	
<para> table in list</para>
	
</entry>
	
<entry>
	
<para>table in list</para>
	
</entry>
	
</row>
	
<row>
	
<entry>
	
<para>table in list</para>
	
</entry>
	
<entry>
	
<para>table in list</para>
	
</entry>
	
</row>
	
</tbody>
	
</tgroup>
	
</table>
								</listitem>
							</list>
						</listitem>
					</list>
				</listitem>
				<listitem>
					<para>two process</para>
				</listitem>
			</list>


For each table, (from matching <tgroup>) I must assess the level of nesting
within the list and then assign a table width appropriately......eg
Example 1.

<list>
   <listitem>
	<table>
	     <tgroup>
This is 1st level nesting of the table and I wish the width to be 90%, my
xsl for that is similar to.....

	<xsl:when test="name(../../..)='list' or
name(../../..)='orderedList'">
		<xsl:attribute name="width">
		<xsl:text>90%</xsl:text>
		</xsl:attribute>
	</xsl:when>						

Example 2.

<list>
   <listitem>
      <list>
         <listitem>
	     <table>
	       <tgroup>
This is 2nd level nesting of the table and I wish the width to be 85%, my
xsl for that is similar to.....

	<xsl:when test="name(../../../../..)='list' or
name(../../../../..)='orderedList'">
		<xsl:attribute name="width">
		<xsl:text>85%</xsl:text>
		</xsl:attribute>
	</xsl:when>	

Ive carried on above onto the 3rd level of nesting (80%) but realise that
this isnt the best way as I am not catering for any deeper levels (4th
onwards).....is there a shortcut I can use to achieve this?	

You could say .... count each list/listItem pair and thats the level of
nesting required (1st, 2nd etc...)........?		


Kind Regards

Karen




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.