473,498 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to embed XSL expression within an attribute?

Hello,
I am outputting HTML from an XSLT and I am having trouble setting
the value of a form-action field based on certain conditions. Here is
the non-working code:

<xsl:template match="dictionary-link[$no-dictionary = 'false']">
<form name="dictionaryform" method="get"
action="<xsl:choose><xsl:when
test="$var1=''">dictionary.jsp</xsl:when><xsl:otherwise>dictionary.jsp</xsl:otherwise></xsl:choose>"
target="dictwin" onSubmit="dictwin=window.open('','dictwin','fullsc reen=no,toolbar=no,status=no,menubar=no,scrollbars =yes,resizable=yes,directories=no,location=no,widt h=300,height=400')">
<div class="dictionary-link">
<table width="100%"><tr>
<td align="left" width="33%">
Look up a word
</td>
<td align="center" width="33%">
<input type="text" name="word" size="20"/>
</td>
<td align="right" width="33%">
<input type="image" alt="Go" border="0"
src="gobutton.gif"/>
</td>
</tr></table>
</div>
</form>
</xsl:template>
When I try and run the transform, things crash and burn because I'm
told the value of the "action " attribute cannot contain "<". Can
anyone suggest a work-around?

Thanks, -
Jul 20 '05 #1
2 1884
D. Alvarado wrote:
Hello,
I am outputting HTML from an XSLT and I am having trouble setting
the value of a form-action field based on certain conditions. Here is
the non-working code:

<xsl:template match="dictionary-link[$no-dictionary = 'false']">
<form name="dictionaryform" method="get"
action="<xsl:choose><xsl:when
test="$var1=''">dictionary.jsp</xsl:when><xsl:otherwise>dictionary.jsp</xsl:otherwise></xsl:choose>"
target="dictwin" onSubmit="dictwin=window.open('','dictwin','fullsc reen=no,toolbar=no,status=no,menubar=no,scrollbars =yes,resizable=yes,directories=no,location=no,widt h=300,height=400')">
<div class="dictionary-link">
<table width="100%"><tr>
<td align="left" width="33%">
Look up a word
</td>
<td align="center" width="33%">
<input type="text" name="word" size="20"/>
</td>
<td align="right" width="33%">
<input type="image" alt="Go" border="0"
src="gobutton.gif"/>
</td>
</tr></table>
</div>
</form>
</xsl:template>
When I try and run the transform, things crash and burn because I'm
told the value of the "action " attribute cannot contain "<". Can
anyone suggest a work-around?


Create the attribute with <xsl:attribute/>

http://www.w3.org/TR/xslt#element-attribute

Ciao,
Igor

Jul 20 '05 #2
D. Alvarado wrote:
When I try and run the transform, things crash and burn because I'm
told the value of the "action " attribute cannot contain "<". Can
anyone suggest a work-around?


<xsl:template match="dictionary-link[$no-dictionary = 'false']">
<form name="dictionaryform" method="get" ...>
<xsl:attribute name="action">
<xsl:choose>
<xsl:when test="$var1=''">dictionary.jsp</xsl:when>
<xsl:otherwise>dictionary.jsp</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
...
</form>
</xsl:template>

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #3

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

Similar topics

3
5201
by: Tony Sutton | last post by:
I have this following code in my html file: <object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#...
11
4462
by: Anna | last post by:
Hi all. I want to embed the EMBED tag in the object tag. I understood that I need to provide a PARAM tag inside the OBJECT whose value will hold the content of EMBED src attribute, but after...
10
6282
by: Anna | last post by:
Hi all. I don't have a very deep understanding of CSS and this question might sound stupid for you. Sorry for that. Can the overflow CSS property be applied to the embed tag? I have an embed...
7
5703
by: alphatan | last post by:
Is there relative source or document for this purpose? I've searched the index of "Mastering Regular Expression", but cannot get the useful information for C. Thanks in advanced. -- Learning...
2
3269
by: Annu | last post by:
Hi I need help on <enbed> tag. Following code(No 1) is working properly on windows but on linux code no.2 is not working Code No 1: <EMBED type='application/x-mplayer2' ...
1
3423
by: snicks | last post by:
I have a series of XLS files which I need to embed into a PowerPoint presentation on an IIS server. I’ll be using VB.NET. I’ve tried using an ASPOSE.PowerPoint control to do this and it does...
1
2955
by: Andrew Poulos | last post by:
With "normal" SWF HTML there's an EMBED tag nested within an OBJECT tag. How can I check which tag is actually displaying the SWF? I'm using CSS on them and the style on the OBJECT affects the...
5
2155
by: elbin | last post by:
Hello, first to say that I am a total beginner in Javascript but I know some programming (python in particular) and am able to understand methods/parameters and so on. Here's my problem: I am...
2
8047
dream party
by: dream party | last post by:
Inserting a Flash (SWF, FLV) file into HTML web page is already an old and familiar thing to all of us. It is a rather non-flexible thing that just to edit some options in the template. However, I...
0
7125
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
7004
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
7167
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,...
0
7208
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...
0
5464
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,...
1
4915
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
4593
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...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1423
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.