I am looping through a list of categories and want to display the list
horizontally (instead of vertically). I want to create a single row
with 4 list items in each cell of the row.
I thought this would work but I get this error:
"End tag 'xsl:if' does not match the start tag 'ul'."
Any thoughts?
<table border="1">
<tr>
<xsl:for-each select="categor y">
<!-- START CELL & LIST -->
<xsl:if test="position( ) = 1">
<td><ul>
</xsl:if>
<!-- LIST CATEGORY NAME -->
<li><xsl:valu e-of select="@name"/></li>
<!-- IF 4 LISTED: CLOSE LIST/CELL AND START NEW CELL -->
<xsl:if test="position( ) mod 4 = 0 and position() != last()">
</ul></td><td><ul>
</xsl:if>
<!-- CLOSE CELL IF LAST ITEM -->
<xsl:if test="position( ) = last()">
</ul></td>
</xsl:if>
</xsl:for-each>
</tr>
</table> 8 4662
Can you post a sample input and desired output?
--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
"bearclaws" <go**********@b encannon.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. . I am looping through a list of categories and want to display the list horizontally (instead of vertically). I want to create a single row with 4 list items in each cell of the row.
I thought this would work but I get this error: "End tag 'xsl:if' does not match the start tag 'ul'."
Any thoughts?
<table border="1"> <tr> <xsl:for-each select="categor y"> <!-- START CELL & LIST --> <xsl:if test="position( ) = 1"> <td><ul> </xsl:if>
<!-- LIST CATEGORY NAME --> <li><xsl:valu e-of select="@name"/></li>
<!-- IF 4 LISTED: CLOSE LIST/CELL AND START NEW CELL --> <xsl:if test="position( ) mod 4 = 0 and position() != last()"> </ul></td><td><ul> </xsl:if>
<!-- CLOSE CELL IF LAST ITEM --> <xsl:if test="position( ) = last()"> </ul></td> </xsl:if>
</xsl:for-each> </tr> </table>
Tempore 20:39:42, die Friday 18 February 2005 AD, hinc in foro {comp.text.xml} scripsit bearclaws <go**********@b encannon.com>: I am looping through a list of categories and want to display the list horizontally (instead of vertically). I want to create a single row with 4 list items in each cell of the row.
<table border="1"> <tr> <xsl:for-each select="categor y"> <!-- START CELL & LIST --> <xsl:if test="position( ) = 1"> <td><ul> </xsl:if>
<!-- LIST CATEGORY NAME --> <li><xsl:valu e-of select="@name"/></li>
<!-- IF 4 LISTED: CLOSE LIST/CELL AND START NEW CELL --> <xsl:if test="position( ) mod 4 = 0 and position() != last()"> </ul></td><td><ul> </xsl:if>
<!-- CLOSE CELL IF LAST ITEM --> <xsl:if test="position( ) = last()"> </ul></td> </xsl:if>
</xsl:for-each> </tr> </table>
Hi,
Firstly, XSLT is written in XML. This document snippet is certainly not well-formed xml and will therefore never pass through parse stage.
Secondly, the algorithm you're trying to express cannot work in XSLT. In Xslt you can't create tags; you create nodes. These creations are atomic and cannot possibly be split in two halves.
The solution to your problem is grouping.
Here's one example of working code:
<table border="1">
<tr>
<xsl:for-each select="categor y[(position() -1) mod 4 = 0]">
<td><ul>
<xsl:for-each select=". | following-sibling::catego ry[position() < 4]">
<li><xsl:valu e-of select="@name"/></li>
</xsl:for-each>
</ul></td>
</xsl:for-each>
</tr>
</table>
regards,
--
Joris Gillis ( http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
"Quot capita, tot sententiae" - Terentius , Phormio 454
Joris -
Your solution worked perfectly!
I figured it had something to do with the separated tags but couldn't
find any solid examples online.
Many thanks,
BC
Joris -
Your solution worked perfectly!
I figured it had something to do with the separated tags but couldn't
find any solid examples online.
Many thanks,
BC
Joris -
Your solution worked perfectly!
I figured it had something to do with the separated tags but couldn't
find any solid examples online.
Many thanks,
BC
On 18 Feb 2005 11:39:42 -0800, "bearclaws"
<go**********@b encannon.com> wrote: I am looping through a list of categories and want to display the list horizontally (instead of vertically).
Then use CSS to control the presentation of the <ul>, don't mess with
tables.
Tempore 17:44:14, die Saturday 19 February 2005 AD, hinc in foro {comp.text.xml} scripsit Andy Dingley <di*****@codesm iths.com>: I am looping through a list of categories and want to display the list horizontally (instead of vertically).
Then use CSS to control the presentation of the <ul>, don't mess with tables.
I completely agree
--
Joris Gillis ( http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
Ceterum censeo XML omnibus esse utendum This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Akseli Mäki |
last post by:
Hi,
the subject say quite a lot. I have about the following code(4.01
transitional):
<p>blaa blaa blaa
<ul>
<li><a href="foo.html">foo</a></li>
<li><a href="bar.html">bar</a></li>
</ul>
|
by: Mark Moore |
last post by:
It looks like there's a pretty serious CSS bug in IE6
(v6.0.2800.1106). The HTML below is validated STRICT HTML 4.01 and
renders as I would expect in Opera, FrontPage, and Netscape.
For some reason, there's an annoying vertical gap between adjacent
rules that doesn't go away. This looks like IE6 is incorrectly
setting the margin to some arbitrary value.
Does anyone know if this is a known bug at MS? If you know of one,
post the...
|
by: Randall Sell |
last post by:
OK, I am utterly stumped. The code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
ul {
background-color: red;
}
|
by: toylet |
last post by:
Given this list of data:
a1 a2 a3
b1 b2 b3
How could I tabulate them without using a table? I knew I could use a
<ul> to list one column list, but how about multiple columns?
--
.~. Might, Courage, Vision. In Linux We Trust.
|
by: slim |
last post by:
hi again all,
i am still working on the website as mentioned in earlier threads and
have hit another snag...
http://awash.demon.co.uk/index.php
http://awash.demon.co.uk/vd.css
the php is pulling a name and placing it under the thumbnail (the text is
| |
by: CMAR |
last post by:
I have the following markup. The problem is that the browser, e.g., IE6,
inserts several lines of blank space between the <div> and the following
table. Is there a way to minimize that vertical spacing?
Thanks, CMA
<div class="vlgray">Condition</div>
<table cellpadding="0" cellspacing="0">
|
by: abro |
last post by:
Problem:
A list contained in a div contains several items that are made of two
parts: itemName and itemValue.
ie:
<div id="data">
<li>longtime1 <span> 1326 mins></span></li>
<li>longtime2 <span> 1692 mins</span></li>
<li> time1 <span> 24 mins </span></li>
|
by: Jerry |
last post by:
I've got a website that uses an external style sheet to manage several of
the design elements. One of the webpages includes an unordered list. I would
like for the list to not be indented at all, with the bullets directly below
the left margin of a standard paragraph of text. All of the content is
included in a table cell. I was able to accomplish that when viewed in IE,
using the following CSS snippet, but both NS and FireFox displays the...
|
by: Man-wai Chang |
last post by:
A 2 columns x 10 rows matrix input form
<ul>
<li>
<ul>
<li>item name 1
<li><input type="textbox" name="input_col_1_row_1">
<li><input type="textbox" name="input_col_1_row_2">
</ul>
<li>
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |