Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old September 5th, 2006, 06:41 AM
Friend of Wrox
 
Join Date: May 2005
Location: Nürnberg/München, , Germany.
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
Default External JavaScript with XSL

Hallo all,

I am sorry that I disturb you again. My XSL works fine but I am having another problem.

I have an external JavaScript which is defined as follows:

            <link href="http://dg1-2.internal.epo.org/_test/Huerol/Factiva/factiva_test.js" lang="javascript" type="text/javascript"/>

I tried to call a function from this script like

                    <td class="text">
                            <h3><a><xsl:attribute name="href">javascript:sendContentRequest(<xsl:num ber value="position()-1" format="1" />,'urn:factiva:developer:v3_0/GetArticle')</xsl:attribute>

                                <xsl:variable name="headline" select="fcs:headline/fcs:paragraph"/>
                                <xsl:variable name="cut" select="substring($headline,0,50)"/>
                                <xsl:variable name="index" select="0"/>
                                    <xsl:value-of select="$cut"/>

                            </a></h3>
                        </td>

But it doesn't call the function. Can anyone help me?

Your attitude determines your altitude
__________________
Your attitude determines your altitude
  #2 (permalink)  
Old September 5th, 2006, 07:07 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

This is an HTML problem, not an XSLT problem. Try to prototype a working HTML page by hand, then use XSLT to generate it. On the other hand, if your prototype HTML page works and you can't get XSLT to generate it, then we need to know what HTML you are trying to generate.

I assume you realize that this Javascript function will only be called when the page has been built and displayed and someone clicks on the link - it won't be called at transformation time.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
  #3 (permalink)  
Old September 5th, 2006, 07:19 AM
Friend of Wrox
 
Join Date: May 2005
Location: Nürnberg/München, , Germany.
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok thanks for that info. I will do that.

Your attitude determines your altitude


Similar Threads
Thread Thread Starter Forum Replies Last Post
Query string to a external javascript file anujrathi ASP.NET 1.0 and 1.1 Professional 1 November 4th, 2006 01:26 AM
external CSS in JavaScript code webdesign Javascript 1 September 1st, 2006 04:35 PM
External Javascript indexed by search engines? Sushifiend3000 Javascript 1 November 27th, 2004 09:31 PM
External Javascript to determine Navigation fs22 Javascript How-To 3 May 21st, 2004 03:42 PM





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