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

RE: Help with staregies for outputting an incremental

Subject: RE: Help with staregies for outputting an incremental number in xslt
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 29 Nov 2007 17:03:45 -0000
RE:  Help with staregies for outputting an incremental
>The first line above has the description "Personal Spend". I dont want to
output this line in the transform, if (and only if) the
transactionType="CorporateCardReconciliation" AND the
CorporateCardSettlementType="personal".

position() counts the nodes that are selected by for-each or by
apply-templates. So if you don't want these nodes counted, don't select
them:

<xsl:for-each select="Line[not(ItemDescription='PersonalSpend' and
transactionType='CorporateCardReconciliation' and
CorporateCardSettlementType='personal']>

.... 

>  > Incidentally, please don't do this:
>  >
>  >>    <xsl:variable name="description">
>  >>      <xsl:value-of select="../../expensys:ItemDescription"/>
>  >>    </xsl:variable>
>  >
>  > when you mean this:
>  >
>  >>    <xsl:variable name="description"
>  > select="../../expensys:ItemDescription"/>
> 
> Point taken - thanks. I do n ot understand the difference 
> between these constructs. Could you advise?

The first one builds a result tree fragment consisting of a document node
and a text node, whose value is a copy of the text of an existing node. The
second one is (a pointer to) an existing node. Creating new nodes and
copying text is expensive, and in this case is quite unnecessary.

Michael Kay
http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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