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

Using SubString

Subject: Using SubString
From: "Yaswanth" <yaswanth.mtrx@xxxxxxxxx>
Date: Fri, 24 Aug 2007 14:29:08 +0530
 Using SubString
Hi All, 

------------------
I have a XML as :

<root>
<connection value ="//every123/event321" />
<connection value ="//once123/every321" />
<connection value ="//every123/every321/event123" />
</root>
-----------------
And my XSL is 

<xsl:template match="root">   
 <xsl:for-each  select="connection"> 
  <xsl:variable name="value" select="@value" />		
  <xsl:if test="contains($value, 'every') and contains($value, 'event')">
   <xsl:text>1 every and 1 Event</xsl:text> 
  </xsl:if>	
  <xsl:if test="contains($value, 'every') and contains($value, 'once')">
   <xsl:text>1 every and 1 once</xsl:text> 
  </xsl:if>	
 </xsl:for-each>
</xsl:template>
----------------
What exactly I am trying to do is for every Connection I am analyzing the
value of @value.

I.e. if I have One every and One event in the @value I am trying to do some
thing similarly with one every and one once!

Now my problem is how can I identify the condition where @value has Two
Every's and One Event (Ex : root/connection[3]/@value)?

How to form a condition?
Can anyone help?

Thanks,
Yaswanth Kumar Ravella

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.