473,594 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using value-of within double quotes??

Hi,

I have a an XML file:

<xml...
<store>
<book>
<title>Darkne ss at Noon</title>
<price>12.99</price>
<url>http://www.amazon.com/...</url>
</book>
Mar 1 '07 #1
4 3931
Figured it out (eventually)

<xsl:for-each select="store/book">
<p><strong><val ue-of select="title" /></strong></p>
<p>&pound;<valu e-of select="price" /></p>
<p><a href="{url}">Bu y book</a></p>
</xsl:for-each>
or use xsl:attribute but havent yet tried that one.

Mar 1 '07 #2
bi******@yahoo. co.uk wrote:
<p><a href="{url}">Bu y book</a></p>
Yep; that's known as an Attribute Value Template (AVT), and is the
simplest way to generate an attribute with a known name.
or use xsl:attribute but havent yet tried that one.
More often used when you need to programmaticall y generate the
attribute's name, or when you need fancier logic in setting its value
than an AVT can support:

<p><a><xsl:attr ibute name="href" select="url"/>Buy book</a></p>
or

<p><a><xsl:attr ibute name="href"><xs l:value-of
select="url"/></xsl:attribute>B uy book</a></p>

or, for stylesheet readability reasons:
<p><a>
<xsl:attribut e name="href"/>
<xsl:value-of select="url"/>
</xsl:attribute>
<xsl:text>Buy book</xsl:text>
</a></p>

.... or any of the equivalents thereof. (XSLT being a programming
language, there is usually more than one way to achieve a given result.)

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Mar 1 '07 #3
Joe Kesselman wrote:
More often used when you need to programmaticall y generate the
attribute's name, or when you need fancier logic in setting its value
than an AVT can support:

<p><a><xsl:attr ibute name="href" select="url"/>Buy book</a></p>
But xsl:attribute in XSLT 1.0 does not have a select attribute
<http://www.w3.org/TR/xslt#creating-attributes>
it is a bit dangerous to show that example above without mentioning it
is only supported in XSLT 2.0
<http://www.w3.org/TR/xslt20/#creating-attributes>


--

Martin Honnen
http://JavaScript.FAQTs.com/
Mar 1 '07 #4
Martin Honnen wrote:
But xsl:attribute in XSLT 1.0 does not have a select attribute
Whups. You're right, very sloppy of me. I did illustrate the
value-as-content solution as well; that does work in 1.0.
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Mar 1 '07 #5

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

Similar topics

6
4099
by: roger beniot | last post by:
I have a program that launches multiple threads with a ThreadStart method like the following (using System.Net.Sockets.Socket for UDP packet transfers to a server): ThreadStart pseudo code: Connect Receive response Send Connect ACK
0
1896
by: zhaoJian | last post by:
Here it is my code ,but it can't update the database.How to do it ? In _UpdateUnit event, I can not get the original value to @Original_UnitID,so I set a hidden column named LabelKey.But It don't update the database.My server is SqlServer 2000. using System; using System.Collections;
5
2193
by: cover | last post by:
I have an input form that passes data when submitted to a second form to let the user know what they have just entered into the db. My question comes with using 'update'. I'd like to query the database by equipment number (equipno is unique) and query all fields from that row, populating an original form 'look alike' whereby the user can add detail to the original records as the db builds. I'm using 'date' twice because I'd like to...
1
2636
by: ansc1 | last post by:
Hello, I'm new to using php coding. I need help with the following: 1. There is a submit button on the form and is saves information to my database. After clicking on "Save Measurement" it redirects me to another page in my site. What I would like to do is change what page directs it to. Currently the submit button redirects me to page /measure/men_measure. I would like to be able to change this. Please see below my page below:...
2
2706
by: =?Utf-8?B?VmljdG9yIExhaQ==?= | last post by:
Hi, I wrote an simple application using VS2005 C#. I am trying to call some functions in my other dll file. This dll is written in EVC for running on Windows CE 5.0. This dll file has the following function exported: void init_GPIO(); void set_GPIO_Value(int value); void set_GPIO_Direction(int direction); UInt16 get_GPIO_Value();
1
2869
by: bsprogs | last post by:
I am currnetly programming a file hosting website in PHP and I am slowly integrating AJAX into the website. Here is my problem: The user uploads the file. The server processes the file and stores a $_SESSION variable. After the upload is complete, the server supplies a link that allows the user to view their link codes. Once they click the link, the page will return the information stored in the $_SESSION variable. The normal link which...
3
7349
by: akristensen | last post by:
I am new to this site, so be patient if I do not ask the question correctly. Current Target Platform: Browser: MS IE, script language: Javascript (will use VBScript, but JS is preferred), External apps: MS Excel What I need to do: From a web page using javascript, I open a new Excel application and sheet, populate some information into it. After it is populated with some information, I need to run the "Solver..." option on the data in the...
2
3144
by: shivendravikramsingh | last post by:
hi friends, i m using a ajax function for retrieving some values from a database table,and display the values in required field,my prob is that the ajax function i m using is working f9 once,but if i change something in php file using in ajax function.it not refreshed,means its shows the previous result it not get updated.i can't understand whats the prob.this is the code i m using: <? include("config.inc.php"); //error_reporting(0); ...
2
4205
by: ajaxcoder | last post by:
Hi In my project i had a login form and i am trying to send the username and password to the server for authentication using xmlHttpRequest. Hence i am using POST request but i am unable to send data. I tried sending using GET request and GET is working fine. Here is code snippet function postRequest() { \n\ if(window.ActiveXObject) \n\ xmlHTTPObj = new ActiveXObject('Microsoft.XMLHTTP'); \n\ else if (window.XMLHttpRequest) \n\
7
16139
by: Andrew | last post by:
Hi, I am using DataContractJsonSerializer to deserialize JSON string in C# objects but I am having a problem. Suppose I have a class: class Item { public ItemId Id { get; set; }
0
7874
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8366
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7997
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8227
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5402
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2383
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 we have to send another system
1
1469
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.