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 4th, 2006, 06:15 AM
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

Hi all,

I am trying to learn the how to pull content from another XML file using the Document ( ) function. Does any one have a linke to a good working sample, showing the XML source and XSLT code?

Thanks for the help.

Bones

 
Old August 4th, 2006, 06:28 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

There are lots of examples in my book. I'm not immediately aware of any others. It might be easier to explain what problem you are having.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old August 4th, 2006, 06:48 AM
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

I am currently at work and left the book at home. I was just trying to learn how to use it.

This is what I have so far:

xml where I want to pull from called source.xml:
Code:
<book>
    <Chapter>
        <Section>
            <SecTitle/>
        </Section>
        <Caution>Caution - THIS IS IT</Caution>
    </Chapter>
</book>
Here is the XSLT calling the document funntion:

Code:
<xsl:template match="JBU:revTEXT">
        <span style="background-color:yellow; ">
            <xsl:value-of select="document('source.xml')/Book/Chapter/Caution"/>
            <xsl:apply-templates/>
        </span>
    </xsl:template>


The XML processed but I dont see the source information.

Thanks for the help

 
Old August 4th, 2006, 06:56 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Your element is called "book", not "Book".

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old August 4th, 2006, 07:08 AM
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

Thanks, I change it but still nothing. Any ideas?

 
Old August 4th, 2006, 08:01 AM
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

never mind, I got it.

YAHOO!!!






Similar Threads
Thread Thread Starter Forum Replies Last Post
xslt document function.. maddukuri XSLT 8 May 16th, 2008 06:31 AM
Document Function Atribute bonekrusher XSLT 2 September 26th, 2006 05:44 PM
Another Document ( ) Function Question bonekrusher XSLT 2 August 4th, 2006 10:45 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.