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 October 11th, 2008, 11:18 AM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Default Onmouseover attrib for element igtxt:WebTextEdit

Hi, Need help please!

I need to add onmouseover for element igtxt:WebTextEdit but it does not seem to work:This works fine but i can't seem to add onmouseover:
      <xsl:when test="$DataType = '' or $DataType = 'Text'">
        <xsl:element name="igtxt:WebTextEdit">
            <xsl:attribute name='id'><xsl:value-of select='$Name' /></xsl:attribute>
            <xsl:attribute name='runat'>server</xsl:attribute>
            <xsl:attribute name='Text'><xsl:value-of select='$Value' disable-output-escaping="yes" /></xsl:attribute>
<xsl:attribute name='onmousemove'>document.getElementById("td_<xs l:value-of select='@name' />").style.color = '#006AB6';</xsl:attribute>
              <xsl:for-each select="$Attributes/Attribute">
              <xsl:if test=". != ''">
                <xsl:attribute name='{@name}'>
                  <xsl:value-of select='.' />
                </xsl:attribute>
              </xsl:if>
            </xsl:for-each>
            <xsl:copy-of select="$Events" />
          </xsl:element>
        </xsl:when>

Mousover code works for other elements that is not igtxt:WebTextEdit
& does nothing on this element.


Please Assist!


 
Old October 11th, 2008, 11:30 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Well XSLT simply creates an attribute in the result tree and I am sure
<xsl:attribute name="onmouseover">foo</xsl:attribute>
will create such an attribute. Whether such an attribute is treated as an event handler when the result of the transformation is rendered in a browser or other application is not an XSLT problem.
I guess (based on the runat="server") that you are trying to create ASP.NET controls with your XSLT transformation so you need to find out whether the WebTextEdit control you are trying to create supports any mouse event handlers like onmouseover. But whether it does or not is not an XSLT problem.

--
  Martin Honnen
  Microsoft MVP - XML
 
Old October 12th, 2008, 01:48 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Perhaps it would help to call your attribute onmouseover rather than onmousemove.

Why is your code so verbose? Instead of this:

<xsl:element name="igtxt:WebTextEdit">
            <xsl:attribute name='id'><xsl:value-of select='$Name' /></xsl:attribute>
            <xsl:attribute name='runat'>server</xsl:attribute>
            <xsl:attribute name='Text'><xsl:value-of select='$Value' disable-output-escaping="yes" /></xsl:attribute>

you can write this:

<igtxt:WebTextEdit
  id="{$Name}"
  runat="server"
  Text="{$Value}">

Also note that disable-output-escaping has no effect when writing an attribute node.

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference
 
Old October 17th, 2008, 03:45 AM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Apologies - my mistake the app i'm developing has a MouseMove property for this object.

Thank You






Similar Threads
Thread Thread Starter Forum Replies Last Post
WebTextEdit ClientSideEvent Javascript-Can't Eval ismailc ASP.NET 2.0 Basics 4 October 14th, 2008 05:14 AM
Webtextedit Mousemove event in XSLT ismailc ASP.NET 2.0 Basics 0 October 11th, 2008 05:53 PM
Problem adding element to the previous element dani1 XSLT 5 September 10th, 2008 01:38 AM
Working with non-Default namespace Elements/Attrib tclotworthy XSLT 3 February 8th, 2007 01:40 PM
How to get attribute values after comparing attrib DipeshKhakhkhar XSLT 0 August 26th, 2003 01:14 PM





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