473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

href values and value-of

Hello. I am creating an xml list of links with structure like the
below:

<item>
<title>Bullet Madness</title>
<uri>http://www.stylegala.com/archive/bulletmadness/</uri>
<description>200 bullets, each of them nice in their own
way</description>
</item>

I need to create a link with that data. When I tried to do something
like
<a href="<xsl:value-of select="uri">">text</a>

I got the error that the structure was not well formed. How else would
I create a link with proper structure?

Thanks, Dante
Jul 20 '05 #1
7 3103
Dante (pi******@reno.com) wrote:
: Hello. I am creating an xml list of links with structure like the
: below:

: <item>
: <title>Bullet Madness</title>
: <uri>http://www.stylegala.com/archive/bulletmadness/</uri>
: <description>200 bullets, each of them nice in their own
: way</description>
: </item>

: I need to create a link with that data. When I tried to do something
: like
: <a href="<xsl:value-of select="uri">">text</a>

: I got the error that the structure was not well formed. How else would
: I create a link with proper structure?
Something like

&lt;a href="<xsl:value-of select="uri">"&gt; text &lt;/a&gt;
Jul 20 '05 #2
Dante (29 Sep 2004 20:46:59 -0700):
<item>
<title>Bullet Madness</title>
<uri>http://www.stylegala.com/archive/bulletmadness/</uri>
<description>200 bullets, each of them nice in their own
way</description>
</item>

I need to create a link with that data. When I tried to do something
like
<a href="<xsl:value-of select="uri">">text</a>


<a>
<xsl:attribute><xsl:value-of select="uri"/></xsl:attribute>
text
</a>

Chris
--
Chris Huebsch www.hübsch-gemacht.de | TU Chemmnitz, Informatik, RNVS
GPG-Encrypted mail welcome! ID:7F2B4DBA | Str. d. Nationen 62, B204
Chemnitzer Linux-Tage 2005, 5.-6.März | D-09107 Chemnitz
http://chemnitzer.linux-tage.de/ | +49 371 531-1377, Fax -1803
Jul 20 '05 #3
In article <sl**************************@chu.informatik.tu-chemnitz.de>,
Chris Huebsch <ch***********@informatik.tu-chemnitz.de> wrote:
<a href="<xsl:value-of select="uri">">text</a>
<a>
<xsl:attribute><xsl:value-of select="uri"/></xsl:attribute>
text
</a>


You forgot the attribute name:

<xsl:attribute name="href"><xsl:value-of select="uri"/></xsl:attribute>

There's a shorthand for attribute values:

<a href="{uri}">text</a>

See "attribute-value-templates" in the XSLT spec.

-- Richard
Jul 20 '05 #4
Richard Tobin (30 Sep 2004 11:02:49 GMT):
You forgot the attribute name:
oh. yes. you are right. Thank you.
<a href="{uri}">text</a>


this looks most elegant.
Chris
--
Chris Huebsch www.hübsch-gemacht.de | TU Chemmnitz, Informatik, RNVS
GPG-Encrypted mail welcome! ID:7F2B4DBA | Str. d. Nationen 62, B204
Chemnitzer Linux-Tage 2005, 5.-6.März | D-09107 Chemnitz
http://chemnitzer.linux-tage.de/ | +49 371 531-1377, Fax -1803
Jul 20 '05 #5
....or use the shortest notation:

<a href="{uri}">text</a>
Joris Gillis
Jul 20 '05 #6
Chris Huebsch <ch***********@informatik.tu-chemnitz.de> wrote in message
<a>
<xsl:attribute><xsl:value-of select="uri"/></xsl:attribute>
text
</a>

Chris

Wouldn't you have to specify the attribute, by doing
<xsl:attribute="href"><xsl:value-of select="uri"/></xsl:attribute>
?

Dante
Jul 20 '05 #7
Dante (30 Sep 2004 08:59:31 -0700):
Wouldn't you have to specify the attribute, by doing
<xsl:attribute="href"><xsl:value-of select="uri"/></xsl:attribute>
?


as others stated already

<xsl:attribute name="href">....
Chris
--
Chris Huebsch www.hübsch-gemacht.de | TU Chemmnitz, Informatik, RNVS
GPG-Encrypted mail welcome! ID:7F2B4DBA | Str. d. Nationen 62, B204
Chemnitzer Linux-Tage 2005, 5.-6.März | D-09107 Chemnitz
http://chemnitzer.linux-tage.de/ | +49 371 531-1377, Fax -1803
Jul 20 '05 #8

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

Similar topics

3
by: martin | last post by:
A page has links that want to invoke the same php file, but pass in different values for a given variable. <a href=process.php?flag=1> Do One </a> <a href=process.php?flag=2> Do Two </a> <a...
3
by: John Smith | last post by:
Is there a way to get Javascript to obey the <BASE HREF=""> tag? I have some code that redirects a user to a template on a different domain, but it keeps taking me to the current domain. Code...
53
by: usenet | last post by:
See <ul> <li><a name="link1" onClick="alert(this.name);return false;" href="#">Link1</a></li> <li><a name="link2" href="javascript:alert(this);">Link2</a></li> <li>Item 3</li> </ul> ...
4
by: Robert Strickland | last post by:
I need to dynamically set the href attribute for the <link> tag at run time for my pages. I thought I saw code using the asp:placeholder to give the code-behind a place to update the html control...
1
by: swatidesai0407 | last post by:
im working on php i want the textbox value to pass in a href it goes as this <input type="text" name="use"> <a href="new.php?cat=textbox value dat is entered"> plz tell me wat to do
8
by: Larry | last post by:
Hi, I'm trying to get the following working but I'm at a loss and dont know what is wrong with it: <div class="name"> <a href=" <xsl:apply-templates select="key" mode="getValue" /"...
6
by: kid | last post by:
hi guys need help again... i need to pass my form values in the browser's address bar using href. can anyone help me on how to do this? thanks and God bless.
1
by: Rob | last post by:
I have values like <span id = "URL">URL</span> where the id "URL" is generated by javascript automatically. I know in JSP, one can pass the value directly like <a href = <%=URL>> but how do I...
4
AMT India
by: AMT India | last post by:
Hi, Where should I put a href in flash,My code is below. <a href="http://www.google.com"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"...
10
by: pt36 | last post by:
Hi I have a page with a form and a textbox. before to submit the form I want to chek if the inserted value in the textbox is already present in a database. So I need to pass the textbox value...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
0
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,...

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.