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

RE: Confused by xsl:for-each

Subject: RE: Confused by xsl:for-each
From: Manpreet Singh <singhm@xxxxxxxxxxx>
Date: Thu, 25 Nov 2004 18:24:59 +0530
manpreet singh
Hi,

  if you want only the <a> tags in your output without its attributes and
text node then you should be using xsl:copy and not xsl:copy-of.
  Else if you want <a>'s attr's and text then what you  are doing is
correct. Just put a root tag for the target document as below.

<xsl:template match="/">
	<foo>
		<xsl:apply-templates select="relation"/>
	</foo>
</xsl:template>

<xsl:template match="relation"> <!-- match is fine-->
	<xsl:for-each select="//a">
		<xsl:copy-of select="."/>
	</xsl:for-each>
</xsl:template>

Regards
Manpreet Singh

-----Original Message-----
From: Robert Soesemann [mailto:rsoesemann@xxxxxxxxxxx]
Sent: Thursday, November 25, 2004 6:17 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Confused by xsl:for-each


Hello, 

I am a bit confused how/why I can't get for-each to work here.

Input:

...
<tr>
  <relation name="relatedAddress" type="address">
    <td>
      <a href="external/address.html">Adresse 1</a><br />
      <a href="error/code.html">Adresse 2</a>
    </td>
  </relation>
</tr>
...

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.