[xsl] listing elements & sub-elements in a seqence - skiping elemts if sub-elemts are present

Subject: [xsl] listing elements & sub-elements in a seqence - skiping elemts if sub-elemts are present
From: Karl <call14@xxxxxxxxx>
Date: Tue, 25 Jul 2006 11:45:50 +0100 (BST)
Thanks David / Charles for the reply and yes the code <xsl:for-each
select="//Session/Section[not(SubSection)] |
//Session/Section/SubSection"/> worked. Infact I did tried this
before writing to the list but an spelling err from my side made me
to think the code was wrong. Sorry. 

But after seeing Chris's reply, I have a q

<xsl:for-each select="//Section[not(SubSection)] |
//Section/SubSection"/>
is definetly giving me the correct order of section and subsection
info that i wanted.

will charles's suggestion,

<xsl:template match="section[not(subsection)]">
 ...
</xsl:template>

& 

<xsl:template match="section[subsection]">
 ...
</xsl:template>

Then simply apply-templates, WILL GIVE THE RESULTS IN SAME ORDER as
that of for-each? [Pls note my actual reqmt is to generate pages with
specific name order and list them in specific order with links etc.
But I have simplified here to get the essence that I expect to
acheive] i.e,

<Section/>  will become  1.Section title in list + creat pg 1
<Section/>  
<Section/>  will become list num 3.Section title & pg 3

<Section>  ** [No pagebreaks/pagenums SINCE IT HAS <subsection> 
 <SubSection/>  So, this become 4. Subsection title (pg 4) 
 <SubSection/>  
 <SubSection/>  will become 6. Subsection title (pg 6)
<Section>  
and so on?

Thanks
karl


	
	
		
___________________________________________________________ 
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine 
http://uk.docs.yahoo.com/nowyoucan.html

Current Thread