This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Tokenising the string using xpath funcitons.



Hi Joshua,
	Thanks for the help. Sorry. I didn't explian my problem clearly.
There are other elements/attributes in the orders template. So I can not
use that template which recursively prints all the orders at a time. I need
a template which I should be able to call from order template and gives me
the corresponding value. I have modified the template as per my requirement.
Based on the position it returns exact value to order template. Is there any
way
I can customise this template to perform better. If I have 20 orders, for 20
the order
this template will be called recursively 20 times. Is there any way in which
I can 
avoid this.

Thanks,
Raj.


	<xsl:template name="GetAttrMapVlaue">
    <xsl:param name="delimStr"/>
    <xsl:param name="SegmentPos" />
    <xsl:param name="Iterator" select="'1'"/>
    
	 <xsl:choose>
	    <xsl:when test="$Iterator=$SegmentPos">
	     		<xsl:value-of
select="substring-before($delimStr,':')" />        
	    </xsl:when>
	     <xsl:otherwise>
     		<xsl:call-template name="GetAttrMapVlaue">
     			<xsl:with-param name="delimStr"
select="substring-after($delimStr, ':')" />
					<xsl:with-param name="SegmentPos"
select="$SegmentPos" />
					<xsl:with-param name="Iterator"
select="$Iterator+1" />
	    		</xsl:call-template>
	     </xsl:otherwise>
    </xsl:choose>
	</xsl:template>







<customer>
	<order>28</order>
	<order>99</order>
	<order>113</order>
	<order>98</order> ( and so on..)
</customer>

> -----Original Message-----
> From:	Joshua.Kuswadi@BTFinancialgroup.com
> [SMTP:Joshua.Kuswadi@BTFinancialgroup.com]
> Sent:	Tuesday, September 25, 2001 6:47 PM
> To:	xsl-list@lists.mulberrytech.com
> Subject:	RE: [xsl] Tokenising the string using xpath funcitons.
> 
> Hi Raj,
> 
> Have a look at this FAQ answer on Dave Pawson's site:
> 	http://www.dpawson.co.uk/xsl/sect2/N1755.html
> 
> It describes the use of a recursive template to do exactly what you're
> looking for.
> 
> HTH,
> Joshua
> 
> > 	Hi, 
> > 		I have a string like this
> > (ACT=28:99:113:98:99:109:114:114:156:28:) in xsl file.
> > I am getting this string from extension function. Number of 
> > entries in the
> > string is not fixed.
> > I want to basically parse the string and get all the values. 
> 
> --------------------------------------------------------------------------
> ----
> This message and any attachment is confidential and may be privileged or
> otherwise protected from disclosure.  If you have received it by mistake
> please let us know by reply and then delete it from your system; you
> should not copy the message or disclose its contents to anyone.
> 
> 
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

"MMS <firstam.com>" made the following
 annotations on 10/01/01 11:57:54
------------------------------------------------------------------------------
"THIS E-MAIL MESSAGE AND ANY FILES TRANSMITTED HEREWITH, ARE INTENDED SOLELY FOR THE USE OF THE INDIVIDUAL(S) ADDRESSED AND MAY CONTAIN CONFIDENTIAL, PROPRIETARY OR PRIVILEGED INFORMATION.  IF YOU ARE NOT THE ADDRESSEE INDICATED IN THIS MESSAGE (OR RESPONSIBLE FOR DELIVERY OF THIS MESSAGE TO SUCH PERSON) YOU MAY NOT REVIEW, USE, DISCLOSE OR DISTRIBUTE THIS MESSAGE OR ANY FILES TRANSMITTED HEREWITH.  IF YOU RECEIVE THIS MESSAGE IN ERROR, PLEASE CONTACT THE SENDER BY REPLY E-MAIL AND DELETE THIS MESSAGE AND ALL COPIES OF IT FROM YOUR SYSTEM."

==============================================================================


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]