[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Dsiplayig xml in tables
Ricaud, many thanks - that gives me something to work from! And it also appears to work fine in Mozilla. thanks again On Wed, 2004-03-10 at 11:26, Ricaud Matthieu wrote: > Hi ! > > I had written a stylesheet that display any xml file in table (clicking on a case display the childrens), maybe it can help you. > (It works fine on IE, i did not test other browsers...) > > So this is it : > > <?xml version="1.0"?> > <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > <xsl:output method="html" encoding="Windows-1252"/> > > <xsl:template match="/*"> > <html> > > <style type="text/css"> > .FERME {background-color:#BBBBCC; font-family: Verdana; font-size: 8pt; cursor:pointer;} > .OUVERT { background-color:#EEF3FB; font-style:blod;font-family: Verdana; font-size: 8pt; cursor:pointer;} > .DERNIER { font-style:blod;font-family: Verdana; font-size: 8pt;} > .VALEURNOEUD { background-color:#FFFFCC; font-family: Verdana; font-size: 8pt;} > .ATTRIBUT {color:#999999;} > </style> > > > <script language="javascript"> > function affiche_cache(objet){ > ObjetCible=objet.parentNode.nextSibling; > if (ObjetCible.style.display=="none"){ > ObjetCible.style.display="block"; > objet.className="OUVERT"; > } > else{ > ObjetCible.style.display="none"; > objet.className="FERME"; > } > } > </script> > > <body> > <table width="100%" align="center" border="1"> > <tr> > <td width="100%" align="center" class="OUVERT" onclick="javascript:affiche_cache(this);"> > <xsl:attribute name="colspan"><xsl:value-of select="count(child::*)"/></xsl:attribute> > <b><xsl:value-of select="name()"/></b> > (<span class="ATTRIBUT"><xsl:for-each select="@*"><b><xsl:value-of select="name()"/></b> : <i><xsl:value-of select="."/></i>  </xsl:for-each></span>) > </td> > </tr> > <tr> > <xsl:apply-templates select="*"/> > </tr> > </table> > </body> > </html> > </xsl:template> > > > <xsl:template match="*"> > <td valign="top" bgcolor="white"> > <xsl:choose> > > <xsl:when test="*"> > <table width="100%" align="center" border="1"> > <tr> > <td width="100%" align="center" class="FERME" onclick="javascript:affiche_cache(this);"> > <xsl:attribute name="colspan"><xsl:value-of select="count(child::*)"/></xsl:attribute> > <b> <xsl:value-of select="name()"/></b> > (<span class="ATTRIBUT"><xsl:for-each select="@*"><b><xsl:value-of select="name()"/></b> : <i><xsl:value-of select="."/></i>  </xsl:for-each></span>) > </td> > </tr> > <tr style="display:none"> > <xsl:apply-templates select="*"/> > </tr> > </table> > </xsl:when> > > <xsl:otherwise> > <div class="DERNIER"> > <b><xsl:value-of select="name()"/></b> > (<span class="ATTRIBUT"><xsl:for-each select="@*"><b><xsl:value-of select="name()"/></b> : <i><xsl:value-of select="."/></i> </xsl:for-each></span>) > </div> > <div class="VALEURNOEUD"><xsl:value-of select="."/></div> > </xsl:otherwise> > > </xsl:choose> > </td> > </xsl:template> > </xsl:stylesheet> > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > -- Phillip Nicolson Department of Physics & Astronomy Phone: (0)116 2523581 University of Leicester Email: pjn3@xxxxxxxxxxxxx Leicester LE1 7RH Web: http://www.astrogrid.org XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|