Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML XSL - Concatenation Question

Status
Not open for further replies.

techx

Programmer
May 24, 2001
20
US
Hi All,
I have a problem that I'm having a difficult time figurring out. Managment ussually does this to me, where they try to utilize a skill that I don't have, and expect perfection. That's a discussion for another time. Hers my problem and question. I am new to this so bare with me.

Overview:
xsl being used to transform xml into tabled item list. I am dynamiccly trying to set the items HTML checkbox value attribute through xsl/xml. What I need in the value attribute is a URL, that is used to access servlet from another application.

Problem:
I need to parse together hardcode values with some tage so I can dynamically build the URL. For example: +=concatenation

- " requestType=P&maxRows=1&indexOnly=N&postingDateMin="+<xsl:value-of select="z1"/>+"postingx="+="+<xsl:value-of select="k1"/>

Question:
How can I concatenate hardoced values with elements? Is ther special way to tell xsl processor these are hard coded values?

Heres the a code snippet of were I need to add the string:

<table border="1" cellspacing="0" cellpadding="2" id="table">

<xsl:for-each select="a/c/e" order-by="+ k">

<col width="80"></col><col width="100"></col><col width="100"></col><col width="100"></col><col width="100"></col><col width="100"></col><col width="100"></col>

<tr>
<td width="80" align="center" valign="top">

<xsl:element name="input" use-attributes-sets="checkbox-attribs">
<xsl:attribute name="name">imagebox</xsl:attribute>
<xsl:attribute name="type">checkbox</xsl:attribute>
<xsl:attribute name="value">ADD STRING HERE </xsl:attribute>
</xsl:element>

</td>

Please Help!!!!!!
 
try this:

Code:
<xsl:attribute name="value">
<xsl:value-of select="concat('[URL unfurl="true"]http://www.',[/URL] @whatever, '.com')"/>
</xsl:attribute>

hth

simon
 
Simplest is the curly bracket notation:
Code:
<input type="checkbox" name="url" value="[URL unfurl="true"]http://myurl=P&amp;DateMin={z1}&amp;postingx={k1}"/>[/URL]

Jon

"I don't regret this, but I both rue and lament it.
 
harmful?

Jon

"I don't regret this, but I both rue and lament it.
 
Jonty,

Simplest ?

I find it difficult to read - easily missed - but then we all code in different ways.

As for k5tm's 'harmful' - erm .... yeah, don't see how myself.

8^)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top