 |
| 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
|
|
|
|

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

November 6th, 2006, 07:37 AM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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,
|
|

November 6th, 2006, 08:17 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
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
|
|

November 6th, 2006, 09:05 AM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Michael,
It is giving me error:
"Oject does't support this property or method."
Swapnil.
|
|

November 6th, 2006, 09:09 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
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
|
|

November 6th, 2006, 09:22 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
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)
|
|

November 7th, 2006, 12:39 AM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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,
|
|
 |