473,574 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help - i have a question with xsl

I apologise in advance for asking here. I know its a C# newsgroup, but i
regard this newsgroup as one of the best to come to for dev help.

I want to do this in xsl:
<xsl:if test="true"></tr></xsl:if>

However, i get an error regarding the </trpart not having the initial tag.
How do i do this?

Thank you very much in advance,

Julie.

Jun 27 '08 #1
3 856
"Julie Smith" <ju***@home.com wrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
I apologise in advance for asking here. I know its a C# newsgroup, but i
regard this newsgroup as one of the best to come to for dev help.

I want to do this in xsl:
<xsl:if test="true"></tr></xsl:if>

However, i get an error regarding the </trpart not having the initial
tag.
How do i do this?
XSL is XML and therefore needs to be well formed. You can't conditionally
end an element in the way you are trying to. I notice you've now posted to
the m.p.xsl group which is the best group for this but I think you will need
to post more detail to get a solution.
--
Anthony Jones - MVP ASP/ASP.NET
Jun 27 '08 #2
I'm trying to iterate through a collection and list them in a table going
horizontally, not vertically.
Example of what i've currently got, but not working:

<xsl:variable name="columns" select="5"/>
<table>
<xsl:for-each select="//People">
<xsl:if test="(position () mod $columns) = 0"><tr></xsl:if>
<td>
<xsl:value-of select="@name"/>
</td>
<xsl:if test="(position () mod $columns) = 0"></tr></xsl:if>
</xsl:for-each>
</table>

Does that make sense?
"Anthony Jones" <An*@yadayadaya da.comwrote in message
news:eD******** ******@TK2MSFTN GP03.phx.gbl...
"Julie Smith" <ju***@home.com wrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
>I apologise in advance for asking here. I know its a C# newsgroup, but i
regard this newsgroup as one of the best to come to for dev help.

I want to do this in xsl:
<xsl:if test="true"></tr></xsl:if>

However, i get an error regarding the </trpart not having the initial
tag.
>How do i do this?

XSL is XML and therefore needs to be well formed. You can't conditionally
end an element in the way you are trying to. I notice you've now posted
to
the m.p.xsl group which is the best group for this but I think you will
need
to post more detail to get a solution.
--
Anthony Jones - MVP ASP/ASP.NET

Jun 27 '08 #3

"Julie Smith" <ju***@home.com wrote in message
news:O2******** ******@TK2MSFTN GP03.phx.gbl...
I'm trying to iterate through a collection and list them in a table going
horizontally, not vertically.
Example of what i've currently got, but not working:

<xsl:variable name="columns" select="5"/>
<table>
<xsl:for-each select="//People">
<xsl:if test="(position () mod $columns) = 0"><tr></xsl:if>
<td>
<xsl:value-of select="@name"/>
</td>
<xsl:if test="(position () mod $columns) = 0"></tr></xsl:if>
</xsl:for-each>
</table>

Does that make sense?

Yes and the ever present Martin Honnen has answered it in the xsl group.

--
Anthony Jones - MVP ASP/ASP.NET
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2569
by: sunaina | last post by:
This is the first program I am writing using PHP and Mysql. I am creating a game where user thinks of an object and my program guesses the object while asking series of yes/no questions. All a user has to do is say yes or no to the questions that my program asks. I have coded until the part where once user thinks of an object and enters...
2
1889
by: A. Wiebenga | last post by:
Hi all! I am currently involved in a project in which I am supposed to write a XSLT-transformation sheet for some XML data. I will outline the situation first: I've got one large XML file which is roughly build up like this: <forms> <subform>
9
2914
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with a device. The definition of the table is as follows: CREATE TABLE devicedata ( device_id int NOT NULL REFERENCES devices(id), -- id in the...
1
1727
by: Mohammed Mazid | last post by:
Basically I want to store the answer of a single-choice question (where candidate selects one answer) and multiple-choice question (where candidate selects more than one answer). I would like to store it in a table and then when I run the quiz application on VB, I would like to track answers for both types of questions. Please help me...
13
3692
by: Chua Wen Ching | last post by:
Hi there, I saw this article here in vb.net. http://www.error-bank.com/microsoft.public.dotnet.languages.vb.1/148992_Thread.aspx and http://www.opennetcf.org/forums/post.asp?method=ReplyQuote&REPLY_ID=3922&TOPIC_ID=2224&FORUM_ID=35
28
1878
by: Siv | last post by:
Hi, If I run the following: strSQL = "Select * FROM Clients;" da = New OleDb.OleDbDataAdapter(strSQL, Conn) 'Create data adapter cb = New OleDb.OleDbCommandBuilder(da) 'Create command builder using the datadapter dt = New Data.DataTable da.Fill(dt) 'pour in the...
5
1587
by: Patrick.O.Ige | last post by:
I have an xml and i'm trying to loop each node... When i do FOR EACH i seem not to get my desired result I want to loop through and get only the values that matches the question i specified with the corresponding answers? I don't want to retrieve all the Answer and VoteAnswers nodes <xsl:for-each select="NSurveyVoter/Voter/Question/Answer">...
16
2515
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client uses IE to talk with a server. The user on the client (IE) sees an ASP net page containing a TextBox. He can write some text in this text box and...
0
2392
by: Mike Collins | last post by:
I someone can please help, I am about at an end in trying to figure this out. I am adding some dynamic controls to my page (I found out that I was supposed to be doing that in the oninit event, which I am). I now want to read the text/values of those controls. I have found out that I can read the values if I wait until Page_Load, but then I...
3
1160
by: Perry Langla | last post by:
I can not seem to figure this out, please help. This program worked perfectly in Visual Studio 2003. The program gets the information from an Access Database. I am using OleDbSelectCommand to select certain records. When I run the program and click Button1 the test works OK. The problem is when I select another Button the correct records...
0
7814
marktang
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...
0
7736
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8067
Oralloy
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. ...
0
8249
jinu1996
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...
0
8107
tracyyun
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...
0
6464
agi2029
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...
0
5307
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3756
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1352
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.