View Single Post
  #4 (permalink)  
Old June 1st, 2007, 03:49 AM
mhkay's Avatar
mhkay mhkay is offline
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

So, you know what HTML you want to generate. Which part of it are you having difficulty generating? How does your actual generated HTML differ from the HTML you want to generate?

Incidentally, you don't seem to have discovered attribute value templates. Things like this:

<img border="0" id="plus">
            <xsl:attribute name="SRC">
              <xsl:value-of select="plus"/>

can be written much more concisely as

<img border="0" id="plus" SRC="{plus}"/>

I've no idea what this code is doing:

  <div onclick="window.event.cancelBubble = true;clickOnEntity(this);" onselectstart="return false" ondragstart="return false">
  <xsl:attribute name="plus"><xsl:value-of select="plus"/></xsl:attribute>
  <xsl:attribute name="minus"><xsl:value-of select="minus"/></xsl:attribute>
  <xsl:attribute name="nextS"><xsl:value-of select="nextS"/></xsl:attribute>
  <xsl:attribute name="icon"><xsl:value-of select="icon"/></xsl:attribute>
  <xsl:attribute name="repeat"><xsl:value-of select="repeat"/></xsl:attribute>
  <xsl:attribute name="next"><xsl:value-of select="next"/></xsl:attribute>
  <xsl:attribute name="open">false</xsl:attribute>
  <xsl:attribute name="id">f<xsl:value-of select="@id"/></xsl:attribute>
  <xsl:attribute name="open">false</xsl:attribute>
  <xsl:attribute name="STYLE">
    padding-left: 20px;
    cursor: hand;
    <xsl:if expr="depth(this) > 2">
      display: none;

it seems to generate lots of attributes that aren't defined in HTML and that bear no relation to anything in your desired output. It even generates some attributes twice!

Michael Kay
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference