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

AW: How to address generic unknown elements !

Subject: AW: How to address generic unknown elements !
From: Delaney Robin <Robin.Delaney@xxxxxxx>
Date: Thu, 14 Nov 2002 14:26:52 +0100
xsl generic hierarchy
I'll try and simplify. Complicated version (sorry Agnes :-) ) in my previous
mail.

XML:
		<ABC>       			1st level
			<BCD>			2nd level
				<EFG>123</EFG>  lower levels
			</BCD>
			<BCD>	
				<EFG>456</EFG>
			</BCD>
		</ABC>

and without knowing the tag names try to get 
1) tag-names for descendants of the 2nd level tag (in this case BCD) which
don't themselves have descendants (ie. the lowest level in the hierarchy).
Result: EFG  (but only one time)
2) the values of all tags that don't have descendants. Result: 123 456  (i
think this bit is OK)

What I'm getting is: EFGEFG 123456   
What I want is: EFG 123456
                       

Obviously because of the for-each which iterates 2 times.  How do I limit it
to 1st Occurrance of my "level-2" tag and it's decendants. Can I have two
template matches and how would I describe the path ?

	<xsl:template match="/">
			<xsl:for-each select="?//*[not(*)]">	 ???stuck
here???
				<xsl:value-of select="local-name()"/>	
			</xsl:for-each> 

			<xsl:for-each select=".//*[not(*)]">	    Getting
Values OK
				<xsl:value-of select="node()"/>	
 	  	</xsl:template>

Hopefully a bit clearer ! 
 
Thanks in advance,

Robin

 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.