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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |