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 January 26th, 2010, 03:08 PM
Registered User
 
Join Date: Jan 2010
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default How to get an attribute whose name is xlink:href

Hi, I have the following XML

<ext-link xlink:href="http://....com">www....com</ext-link>

in my xslt, when I have
...
<ext-link xlink:href="{@xlink:href}">
....

When I ran it, it gave me error "
namesapce error : namespace prefix xlink for href on ext-link is not defined.
I tried to use "xlink\:href", it didn't work.

How to call this attribute??
Thanks a lot!!
 
Old January 26th, 2010, 03:31 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

In your xml you should see a namespace declaration for xlink, something like
Code:
xmlns:xlink="http://www.w3.org/1999/xlink"
probably on the root element. You need to add a similar declaration to your XSLT, again this is usually done on the xsl:stylesheet element.
__________________
Joe
http://joe.fawcett.name/
The Following User Says Thank You to joefawcett For This Useful Post:
hpdp (January 26th, 2010)
 
Old January 26th, 2010, 03:44 PM
Registered User
 
Join Date: Jan 2010
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks a lot!!!
It works.





Similar Threads
Thread Thread Starter Forum Replies Last Post
xlink:href, xml and xslt jamesdurham XSLT 7 April 23rd, 2009 06:22 AM
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
Which browsers have support for extended Xlink? ballo XML 0 May 21st, 2006 07:23 AM
Access to attribute values from class of attribute jacob C# 1 October 28th, 2005 01:11 PM
Any xlink experts out there? mountainbiker XML 3 February 29th, 2004 01:49 PM





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