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

Re: Output multiple occurence into one and concatenate

Subject: Re: Output multiple occurence into one and concatenate values
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 29 Mar 2007 21:19:12 +0200
Re:  Output multiple occurence into one and concatenate
Shaikh, Parvez wrote:
Thanks for all the responses.

I am using at the top

<xsl:template match="/">
    <erpayload>
      <xsl:apply-templates select="//erpayload/* | //erpayload/*/*"/>
    </erpayload>
  </xsl:template>



so All I did based on what you said was:

<xsl:template match="cost_allocation_product">


This is not enough. You should have a place where you *apply* the templates. Or even only the attributes, if you want more fine-grained control. I.e.:


<xsl:apply-templates select="somenode/@Product" />

Then, you create the matching template

<xsl:template match="@Product" />

To get all the nodes from a certain context and all its descendants, you can use //somenode/@Product in the apply-templates. The same you can do with other attributes. To create an attribute, do like I told you, add an xsl:attribute around the apply-templates that does the selection.

If you have trouble understanding how apply-templates and matching templates work together, you should consider any of many tutorials or books. Without understanding matching templates, it will be very hard to understand XSLT and to make it work for you.

-- Abel

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-2011 All Rights Reserved.