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 26th, 2006, 04:44 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default Document Function Atribute

Hi All,

I how do I change this document function to get a value based on an atribute?

I want to change 'flight' to '@ele'

<xsl:value-of select="document(@loc)/id('flight')"/>

Thanks



 
Old September 26th, 2006, 05:30 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

In XSLT 2.0 you can write

<xsl:value-of select="document(@loc)/id(current()/@ele)"/>

or

<xsl:value-of select="id(@ele, document(@loc))"/>

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old September 26th, 2006, 05:44 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Michael,

Once again..THANK YOU!

It works perfect. I need to look up the Current() function. I never used it...

Thanks

Bones







Similar Threads
Thread Thread Starter Forum Replies Last Post
xslt document function.. maddukuri XSLT 8 May 16th, 2008 06:31 AM
Another Document ( ) Function Question bonekrusher XSLT 2 August 4th, 2006 10:45 AM
Document ( ) Function bonekrusher XSLT 5 August 4th, 2006 08:01 AM
How to use document() function jacob XSLT 8 November 30th, 2005 08:58 PM
xslt 2.0 document function jkmyoung XSLT 2 November 18th, 2004 03:21 PM





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