xsl-list
[Top] [All Lists]

Re: XSL checkbox

2004-05-18 07:33:38
I am newbie in XSL and I search ALL GOOGLE for an example:((

this is my XSL

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="uri:xsl">
  <xsl:template match="/">
    <SCRIPT>
    function change(title_id)
    {
      alert(title_id);
      var root = detailXSL.documentElement;
      var selectedElems =  root.selectNodes("//xsl:for-each");
      var ifStatement = selectedElems.item(0);
      ifStatement.attributes(0).text =
                      "@title_id[.='" + title_id + "']";

      document.write(titles.transformNode(detailXSL.documentElement));
    }
    </SCRIPT>
    <H3>Titles</H3>
    <TABLE BORDER="1" CELLPADDING="1" CELLSPACING="0">
      <TR>
        <TD BGCOLOR="#C0C0C0"><B>Title</B></TD>
        <TD BGCOLOR="#C0C0C0"><B>Details</B></TD>
      </TR>
      <xsl:for-each select="titlelist/titles" order-by="@title">
        <TR>
          <TD VALIGN="top"><xsl:value-of select="@title"/></TD>
          <TD VALIGN="top"><INPUT>
            <xsl:attribute name="TYPE">checkbox</xsl:attribute>
            <xsl:attribute name="VALUE">c1</xsl:attribute>
            <xsl:attribute name="ONCLICK">

                   <xsl:attribute
name="backgroundcolor">yellow</xsl:attribute>

               <xsl:apply-templates/>

            </xsl:attribute>
          </INPUT></TD>
        </TR>
      </xsl:for-each>
    </TABLE>
    <XML ID="titles" SRC="titles.xml"></XML>
    <XML ID="detailXSL" SRC="details.xsl"></XML>
  </xsl:template>
</xsl:stylesheet>




----- Original Message ----- 
From: "Andrew Welch" <ajwelch(_at_)piper-group(_dot_)com>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Tuesday, May 18, 2004 5:24 PM
Subject: RE: [xsl] XSL checkbox



Hi!
I have a problem!
I have an XML like this:

[snip]

and I want an XSL
which have for every row with the title from xml an checkbox
and when I check this checkbox the background color of row is
changed! thanks

You're asking more html than xslt here - if you know the html you need
but are having problems generating it using xslt, then post the html and
the stylesheet you are using.  Otherwise you may as well just ask 'can
someone do my work for me' :)

--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--




<Prev in Thread] Current Thread [Next in Thread>