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 November 6th, 2006, 04:55 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

In Javascript (like Java and C) a backslash in a string literal must always be escaped as "\\".

However, a legal URI never contains a backslash. URI's use forwards slash as the separator character.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 6th, 2006, 07:37 AM
Registered User
 
Join Date: Nov 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Michael,
One more query,
Please tell me whether there is any mistake in following xslt code lines

<a>
    <xsl:attribute name="href"><xsl:value-of select="NavigateUrl"></xsl:value-of></xsl:attribute>
    <xsl:attribute name="target">DetailsPage</xsl:attribute>
    <xsl:attribute name="onmouseover">doButtons('<xsl:value-of select="ID"></xsl:value-of>', '<xsl:value-of select="ImgUrl1"></xsl:value-of>')</xsl:attribute>
    <xsl:attribute name="onmouseout">doButtons('<xsl:value-of select="ID"></xsl:value-of>', '<xsl:value-of select="ImgUrl2"></xsl:value-of>')</xsl:attribute>
    <img><xsl:attribute name="name"><xsl:value-of select="ID"></xsl:value-of></xsl:attribute>
    <xsl:attribute name="src"><xsl:value-of select="ImgUrl1"></xsl:value-of></xsl:attribute></img>
    </a>

Thanks and regards,
 
Old November 6th, 2006, 08:17 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I'm not into quiz questions. If you think there is an error, tell me why you think there is an error. If you don't, then why ask the question?

I'd suggest you put your complete stylesheet through the Saxon processor. Saxon will tell you whether there are any static errors in it.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 6th, 2006, 09:05 AM
Registered User
 
Join Date: Nov 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Michael,

It is giving me error:

"Oject does't support this property or method."

Swapnil.
 
Old November 6th, 2006, 09:09 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

That looks to me like a Javascript error, not an XSLT error.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 6th, 2006, 09:22 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Let's get this straight, this is entirely a JavaScript problem.
We need to back to basics, what is your XML, what HTML do you want to output?
Write the HTML first by hand and test it, if it works then it should be relatively simple to create from your XML.

If you can't write the HTML by hand then you need to post that as a problem on the Web => Javascript How-To forum.



--

Joe (Microsoft MVP - XML)
 
Old November 7th, 2006, 12:39 AM
Registered User
 
Join Date: Nov 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks to all,

I got the solution,

Problem was in the function--

function doButtons(name, pic)
{
    document.getElementById(name).src = pic; //Here was the problem
}

follwing is the right answer:

function doButtons(name, pic)
{
    document[name].src=pic;
}

Regards,





Similar Threads
Thread Thread Starter Forum Replies Last Post
stop current javascript function using javascript sakthi Javascript 3 June 2nd, 2008 03:30 PM
XSLT Function very urgent alapati.sasi XSLT 3 May 23rd, 2007 03:45 AM
contains function in XSLT 1.0 NEO1976 XSLT 4 February 7th, 2007 06:01 AM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
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.