473,480 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Generating Form Inputs

Hi All,

I'm trying to create a form in my XSLT file and fill in the input tag
attributes with results from an XML transformation. Here's what I'm
doing that's not working:
<INPUT type="checkbox"
name="<xsl:value-of select='@file'/>"
value="<xsl:value-of select='@file'/>"
>
MSXSL reports: The character '<' cannot be used in an attribute value.

How can I perform this task correctly? Thanks.

Aug 4 '06 #1
4 992
HugeBob wrote:
The character '<' cannot be used in an attribute value.
Either use the xsl:attribute directive to construct this attribute
(which can take arbitrarily complex code in its body to build up the
value), or look at the documentation for Attribute Value Templates.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Aug 5 '06 #2
.... or retrieve the value into a variable and set the attribute's value
from that.

XSLT is a programming language; there are usually multiple ways to solve
any problem, and it's a partly matter of deciding which one best
expresses what you're trying to do.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Aug 5 '06 #3
Thanks Joe. AVT's worked out. Previously, I had tried using the
<xsl:attribute ...tag to populate my <INPUT...>'s:

..
..
..
<TD ...>
<input type="checkbox" <----------------- error
<xsl:attribute name="name">
<xsl:value-of select="name"/>
</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="@storyid"/>
</xsl:attribute>

But, my mistake was that I didn't terminate the input tag correctly: />

The processor reported: End tag 'TD' does not match the start tag
'input'. Needless to say, that confused me.
Joe Kesselman wrote:
... or retrieve the value into a variable and set the attribute's value
from that.

XSLT is a programming language; there are usually multiple ways to solve
any problem, and it's a partly matter of deciding which one best
expresses what you're trying to do.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Aug 7 '06 #4
HugeBob schrieb:
Thanks Joe. AVT's worked out.
Good
Previously, I had tried using the
<xsl:attribute ...tag to populate my <INPUT...>'s:

..
..
..
<TD ...>
<input type="checkbox" <----------------- error
<xsl:attribute name="name">
<xsl:value-of select="name"/>
</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="@storyid"/>
</xsl:attribute>

But, my mistake was that I didn't terminate the input tag correctly: />
No, you have to terminate the input element _after_ the xsl:attribute
elements:
<input ...>
<xsl:attribute ...>
...
</xsl:attribute>
<xsl:attribute ...>
...
</xsl:attribute>
</input>
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Aug 7 '06 #5

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

Similar topics

5
5476
by: Yang Li Ke | last post by:
Hi I know that there is a meta tag function to get all meta tags from a url. I am searching for a similar function that would get all values of a form. something like : <form> <input...
4
2104
by: pizzy | last post by:
INTRO: I tried to clean it up for easy reading. I hope I didn't make any mistakes. PROBLEM: WOW, this is some crazy sh!t. I can't get my checkbox (see "TAGSELECTED") to print my textboxes (see...
5
2336
by: pizzy | last post by:
I am having a problem with the last results. I can't seem to be able to get the input2A and input3A to appear. I don't seem to have a problem with the show and hide after a number is entered and...
4
7235
by: jedimasta | last post by:
Good evening all, I'm a relatively new to javascript, but I've been working with ColdFusion and PHP for years so I'm not necessarily ignorant, just stuck and frustrated. Using ColdFusion I'm...
2
1535
jinalpatel
by: jinalpatel | last post by:
I have two tables MainFirm Name Address City State Zip County
0
7049
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,...
0
6912
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...
0
7052
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,...
1
6744
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6981
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...
1
4790
isladogs
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...
0
3000
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...
0
2989
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1304
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 ...

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.