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

RE: How to address generic unknown elements !

Subject: RE: How to address generic unknown elements !
From: "Américo Albuquerque" <aalbuquerque@xxxxxxxxxxxxxxxx>
Date: Thu, 14 Nov 2002 19:23:01 -0000
xsl unknown tag
Hi Delaney

Try this (is not very diferent from yours):

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

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

Hope that this helps.

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Delaney
Robin
Sent: Thursday, November 14, 2002 1:27 PM
To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject: AW:  How to address generic unknown elements !



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



 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.