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 23rd, 2006, 12:00 PM
Authorized User
 
Join Date: Aug 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to populate a value in an attubute section

Hello,

I am trying to get a value from input file and populate the value in the formvalue section. The following is what I did, but I got an error message.

<Books>
  <Book>
   <Title>
     <b><Form formtypid=123 formName=Book formvalue=<xsl:value of select="..path here"/></b>
   </Title>
  </Book>
</Books>

Can someone tell me what's went wrong? and what is the correct way of doing it?

Thanks in advance!

Haixia

 
Old August 23rd, 2006, 12:57 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You can't use an element inside an attribute, so XSLT has another mechanism for constructing attribute values, called an attribute value template or AVT:

<Form formtypid="123" formName="Book" formvalue="{expr}"/>

where expr is any XPath expression.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old August 23rd, 2006, 01:23 PM
Authorized User
 
Join Date: Aug 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Michael,
Thank you very much. It worked!







Similar Threads
Thread Thread Starter Forum Replies Last Post
Add a CDATA section; add nodeset to CDATA section kssudhish XSLT 3 January 3rd, 2008 07:13 AM
Question on section 2.4 owenjgo23 BOOK: Beginning Visual C++ 6 1 July 11th, 2005 05:03 PM
CDATA section kai77 Beginning VB 6 0 October 31st, 2004 04:50 PM
split section Bhavin Crystal Reports 3 October 15th, 2004 05:04 PM
Section formatting cankalu Crystal Reports 1 May 31st, 2004 07:28 PM





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