-
Problem displaying desired output via XSL
Hi,
Hope someone can assist me as I'm stuck at the moment.
I have this XML (shortcut/edited version):
<!-- Line -->
<buttonNumber>1</buttonNumber>
<buttonTypeId>1</buttonTypeId>
<speedDialDisplay/>
<speedDialNumber/>
<sipProxy>proxy.com.au</sipProxy>
<endpoint>
<phoneNumber>09900001</phoneNumber>
<buttonDisplayName>09900001</buttonDisplayName>
<callerDisplayName>09900001</callerDisplayName>
</endpoint>
</builtInButtons>
<!-- Monitor -->
<buttonNumber>2</buttonNumber>
<buttonTypeId>2</buttonTypeId>
<speedDialDisplay/>
<speedDialNumber/>
<sipProxy>proxy.com.au</sipProxy>
<endpoint>
<phoneNumber>09900000</phoneNumber>
<buttonDisplayName>09900000</buttonDisplayName>
<callerDisplayName>09900000</callerDisplayName>
</endpoint>
<!-- Speed Dial -->
<buttonNumber>3</buttonNumber>
<buttonTypeId>3</buttonTypeId>
<speedDialDisplay>Speed Dial Name</speedDialDisplay>
<speedDialNumber>12345678</speedDialNumber>
<sipProxy>proxy.com.au</sipProxy>
<!-- Empty -->
<buttonNumber>4</buttonNumber>
<buttonTypeId>2</buttonTypeId>
<speedDialDisplay/>
<speedDialNumber/>
<sipProxy>proxy.com.au</sipProxy>
</buttons>
The values I'm after are to meet this conditions:
- buttonTypeId either 2 or 3, and speedDialNumber or phoneNumber are not Empty
So using this XSL, I AM ABLE TO GET THE VALUES I'M AFTER
<xsl:for-each select="builtInButtons">
<xsl:if test="buttonTypeId = '2' or buttonTypeId = '3'">
<xsl:if test="endpoint/phoneNumber != '' or speedDialNumber != ''">
The issue i have is DISPLAYING THEM, AS THE OUTPUT NEEDS TO BE INCREMENTAL:
e.g
if there are 2 items, satisfies the conditions, output as:
item.1=<value>
item.2=<value>
if there are 3 items,
item.1=<value>
item.2=<value>
item.3=<value>
I'm able to get the values im after, but displaying it is the problem. using counters, would have fixed the issue easy, however i found the hard way that XSL doesnt do counters.
there should be other way of approaching this, please help ?
Thanks for your help.
Similar Threads
-
By vaibhavs17 in forum Database
Replies: 1
Last Post: 11-10-2008, 07:12 AM
-
Replies: 0
Last Post: 10-22-2001, 08:34 AM
-
By Brijesh Shah in forum XML
Replies: 1
Last Post: 09-27-2001, 01:09 PM
-
By siew keok in forum XML
Replies: 2
Last Post: 08-22-2001, 03:31 PM
-
By Paul Klanderud in forum XML
Replies: 2
Last Post: 02-01-2001, 09:13 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks