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 September 21st, 2006, 09:27 AM
Authorized User
 
Join Date: Sep 2006
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSL and href calls ...

Hi Everyone,

I have href links (hyperlink calls) in my XML and these work fine using the following syntax in my XSL template ...

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

Now I would like to force the browser to open the new page in a separate window (HTML syntax: target="_blank" ) but am not sure how to declare this in my XSL.

I've done some googling but it didn't return anything useful so I am hoping that someone can send me a tip?

Many thanks,
Alan Searle.

 
Old September 21st, 2006, 10:33 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You can write

<xsl:attribute name="target">_blank</xsl:attribute>

though more concise is:

<a href="{MenuTargetObject}" target="_blank">
  (generate the link text)
</a>

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old September 21st, 2006, 11:02 AM
Authorized User
 
Join Date: Sep 2006
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks very much this: Worked perfectly!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 8, href and HRef (p. 285) roman BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 June 16th, 2008 10:40 AM
Including XSL in an <a href> graywoodhouse XSLT 2 November 12th, 2004 06:08 AM
function calls ricmar Access VBA 3 September 24th, 2004 09:15 AM
XSL calls java function - prob vetrikam XSLT 2 October 9th, 2003 10:33 PM
XSL Transform with xsl string NOT xsl file skin XSLT 0 June 16th, 2003 07:30 AM





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