php and xsl problem

This is a discussion on php and xsl problem within the alt.comp.lang.php forums, part of the PHP Programming Forums category; hello, well i have a problem with something, i have an xml file and i have created an xsl file ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-29-2004
tsirman
 
Posts: n/a
Default php and xsl problem

hello,

well i have a problem with something,
i have an xml file and i have created an xsl file to parse my data for
my php page.
all are working OK but i don't know how can i split my data into 2
columns and not in one cell.

i don't know how can i make it but i was thinking 2 ways

1)split the data in the middle

or

2)split tha data per 2. namely in the first cell we can have tha
single one and in the second the even one.



----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
http://www.phpfreaks.com
http://www.phpfreaks.com/forums


Reply With Quote
  #2 (permalink)  
Old 04-29-2004
Janwillem Borleffs
 
Posts: n/a
Default Re: php and xsl problem

tsirman wrote:
> hello,
>
> well i have a problem with something,
> i have an xml file and i have created an xsl file to parse my data for
> my php page.
> all are working OK but i don't know how can i split my data into 2
> columns and not in one cell.
>


You can do this with the xpath mod operator, eg:

<xsl:choose>
<xsl:when test="position() mod 2 = 0">
<!-- Even row -->
</xsl:when>
<xsl:otherwise>
<!-- Odd row -->
</xsl:otherwise>
</xsl:choose>

Use this with apply-templates or for-each.


JW



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:14 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0