Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 24th, 2007, 07:03 PM
Registered User
 
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Coding question (New to XSLT)

I'm a XSLT novice, who is trying to modify an XSLT Google Search Appliance FrontEnd.

I've managed to work my way through most of the code, but have run into a problem when I try to code the following.

<meta name="jc.wss" content="<xsl:value-of select='$space_normalized_query'/>">

I'm trying to pass the $space_normalized_query into the content attribute, but it keeps failing. I've tried escaping the brackets before and after the "content" quotes (that is "<xsl:value-of select='$space_normalized_query'/>"), but nothing seems to work.

Can anyone set me on the right path?

Thanks!

 
Old August 25th, 2007, 02:41 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

XSLT uses XML syntax, and XML doesn't allow elements to appear within attributes.

There's a special syntax for this called attribute value templates:

<meta name="jc.wss" content="{$space_normalized_query}"/>

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old August 26th, 2007, 03:42 PM
Registered User
 
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, Michael, for the help! It worked perfectly!

Regards,
JC






Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone help on this xslt coding srkumar XSLT 3 January 3rd, 2008 07:44 AM
Anyone help on this XSLT coding srkumar XSLT 1 December 17th, 2007 05:25 AM
Good XSLT coding Architecture for transformation anil2020 XSLT 0 August 27th, 2007 12:10 PM
need guidance in inserting field ( coding question gilgalbiblewheel Classic ASP Databases 3 April 19th, 2005 06:25 PM
Coding question aagway Access VBA 1 May 4th, 2004 02:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.