nicolaken 02/03/18 11:22:19 Added: src/webapp/samples/common/style/css jakarta_apache_org.css src/webapp/samples/common/style/xsl/html directory2html.xsl error2html.xsl profile2html.xsl simple-samples2html.xsl simple-sitemap2html.xsl simple-xml2html.xsl Log: Partial commit of new samples structure. Samples go in samples/ dir with theit own sitemap. All scratchpad samples that are in the samples/ subdir are copied in webapp samples automatically by installscratchpadwar target. cocoon.xconf is moved in WEB-INF for security reasons. Added new "gump" target to build; it calls docs, javadocs, test and package. Revision Changes Path 1.1 xml-cocoon2/src/webapp/samples/common/style/css/jakarta_apache_org.css Index: jakarta_apache_org.css =================================================================== body { font-family: "Times New Roman", Times, serif; font-style: normal; color: #000000; background-color: #FFFFFF; } h1 { font-family: Arial, Helvetica, sans-serif; color: #0033CC } h2 { font-family: Arial, Helvetica, sans-serif; color: #0033CC } h3 { font-family: Arial, Helvetica, sans-serif; color: #0033CC } b { font-weight: bold; } .code { font-family: Courier, mono; } .codeblock { font-family: Courier, mono; } .navheading { font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #0033CC } .navitem { font-family: "Times New Roman", Times, serif; margin-left: 10pt; color: #000000 } .itemdef { font-family: "Times New Roman", Times, serif; font-size: smaller; color: #000000 } .fineprint { font-family: Arial, Helvetica, sans-serif; font-size: smaller; color: #000000 } 1.1 xml-cocoon2/src/webapp/samples/common/style/xsl/html/directory2html.xsl Index: directory2html.xsl =================================================================== <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dir="http://apache.org/cocoon/directory/2.0"> <xsl:template match="/"> <html> <head> <title><xsl:value-of select="dir:directory/@name"/></title> </head> <body bgcolor="#ffffff"> <h1>Directory Listing of <xsl:value-of select="dir:directory/@name"/></h1> <table border="0"> <tr> <td> <a href="../"><i>parent directory</i></a> </td> </tr> <tr> <td>   </td> </tr> <xsl:apply-templates/> </table> </body> </html> </xsl:template> <xsl:template match="dir:directory/dir:directory"> <tr> <td> <a href="{@name}/"><i><xsl:value-of select="@name"/></i></a> </td> <td> <xsl:value-of select="@date"/> </td> </tr> </xsl:template> <xsl:template match="dir:file"> <tr> <td> <a href="{@name}"><xsl:value-of select="@name"/></a> </td> <td> <xsl:value-of select="@date"/> </td> </tr> </xsl:template> </xsl:stylesheet> 1.1 xml-cocoon2/src/webapp/samples/common/style/xsl/html/error2html.xsl Index: error2html.xsl =================================================================== <?xml version="1.0"?> <!-- Author: Nicola Ken Barozzi "[EMAIL PROTECTED]" --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:error="http://apache.org/cocoon/error/2.0"> <xsl:template match="error:notify"> <html> <head> <title> <xsl:value-of select="@error:type"/>:<xsl:value-of select="error:title"/> </title> <style><![CDATA[ <!-- H1{font-family : sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;} BODY{font-family : sans-serif,Arial,Tahoma;color : black;background-color : white;} TABLE{font-family : sans-serif,Arial,Tahoma;color : black;background-color : black;} B{color : white;background-color : #0086b2;} HR{color : #0086b2;} //-->]]> </style> <script language="JavaScript1.2"><![CDATA[ <!-- var head="display:''" function expand(whatToExpand) { var head=whatToExpand.style if (head.display=="none"){ head.display="" } else{ head.display="none" } } //-->]]> </script> </head> <body> <table align="center" border="0" bgcolor="#000000" cellpadding="0" cellspacing="0"> <tbody> <tr> <td> <table align="center" border="0" bgcolor="#000000" cellpadding="2" cellspacing="2"> <tbody> <tr> <td bgcolor="#0086b2" colspan="2"> <font color="#ffffff" size="+2"> <xsl:value-of select="error:title"/> </font> </td> </tr> <tr> <td bgcolor="#ffffff" colspan="2" valign="top"> <font color="#000000"> The <xsl:value-of select="@error:sender"/> notifies that <xsl:value-of select="error:source"/> says:<br/><br/> <i><xsl:call-template name="returns2br"> <xsl:with-param name="string" select="error:message"/> </xsl:call-template></i><br/><br/> More precisely:<br/><br/> <i><xsl:call-template name="returns2br"> <xsl:with-param name="string" select="error:description"/> </xsl:call-template></i><br/> <br/> </font> </td> </tr> <!-- <tr> <td bgcolor="#0086b2" valign="top"> <font color="#ffffff" size="+1"> <xsl:value-of select="@error:type"/> </font> </td> <td bgcolor="#ffffff" > <xsl:apply-templates select="error:message"/> </td> </tr> <tr> <td bgcolor="#0086b2" valign="top" colspan="2"> <font color="#ffffff" size="+1">details</font> </td> </tr> <tr> <td bgcolor="#0086b2" valign="top"> <font color="#ffffff">from</font> </td> <td bgcolor="#ffffff"> <font face="arial,helvetica,sanserif"> <xsl:value-of select="@error:sender"/> </font> </td> </tr> <tr> <td bgcolor="#0086b2" valign="top"> <font color="#ffffff">source</font> </td> <td bgcolor="#ffffff"> <font face="arial,helvetica,sanserif"> <xsl:value-of select="error:source"/> </font> </td> </tr> <xsl:apply-templates select="error:description"/> --> <tr> <td bgcolor="#0086b2" valign="top" colspan="2"> <font color="#ffffff" size="+1">extra info</font> </td> </tr> <xsl:apply-templates select="error:extra"/> <tr> <td bgcolor="#ffffff" colspan="2" valign="top"> <font color="#000000" size="-1"> <br/> If you need help and this information is not enough, you are invited to read the <a href="http://xml.apache.org/cocoon/faq.html">cocoon faq</a>.<br/> If you still don't find the answers you need, can send a mail to the <a> <xsl:attribute name="href">mailto:[EMAIL PROTECTED]?subject=[HELP]<xsl:value-of select="error:message"/>&body=Description:<xsl:value-of select="error:description"/></xsl:attribute> Cocoon users mailing list</a>, remembering to <ul> <li> specify the version of Cocoon you're using, or we suppose that you are talking about the latest version;</li> <li>specify the taglibs and sitemap components that are pertinent;</li> <li>specify the platform-operating system-version-servlet container version;</li> <li>send any pertinent error message;</li> <li>send pertinent log snippets;</li> <li>send pertinent sitemap snippets;</li> <li>send pertinent parts of the page that gives you problems.</li> </ul> For more detailed technical information, take a look at the log files in the log directory of cocoon, which is <code>/WEB-INF/logs</code> by default.<br/> Logging configuration is by default in <code>/WEB-INF/logkit.xconf.</code><br/><br/> If you think you found a bug, please report it to <a href="http://nagoya.apache.org/bugzilla/">Apache's Bugzilla</a>; a message will be sent to the developer mailing list.<br/> </font> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </body> </html> </xsl:template> <xsl:template match="error:description"> <tr> <td bgcolor="#0086b2" valign="top"> <font color="#ffffff" face="arial,helvetica,sanserif">description</font> </td> <td bgcolor="#ffffff"> <xsl:call-template name="returns2br"> <xsl:with-param name="string" select="."/> </xsl:call-template> </td> </tr> </xsl:template> <xsl:template match="error:message"> <xsl:call-template name="returns2br"> <xsl:with-param name="string" select="."/> </xsl:call-template> </xsl:template> <xsl:template match="error:extra"> <tr> <td bgcolor="#0086b2" valign="top"> <font color="#ffffff"> <xsl:value-of select="@error:description"/> </font> </td> <td bgcolor="#ffffff"> <font size="-1"> <xsl:choose> <xsl:when test="contains(@error:description,'stacktrace')"> <!-- degrade gracefully on Netscape--> <a href="javascript:" onclick="expand(document.all[this.sourceIndex+2])"><script>if(document.all){document.write('show');}</script></a> <div style="display:'none';"> <xsl:call-template name="returns2br"> <xsl:with-param name="string" select="."/> </xsl:call-template> </div> </xsl:when> <xsl:otherwise> <xsl:call-template name="returns2br"> <xsl:with-param name="string" select="."/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </font> </td> </tr> </xsl:template> <xsl:template name="returns2br"> <xsl:param name="string"/> <xsl:variable name="return" select="'
'"/> <xsl:choose> <xsl:when test="contains($string,$return)"> <xsl:value-of select="substring-before($string,$return)"/> <br/> <xsl:call-template name="returns2br"> <xsl:with-param name="string" select="substring-after($string,$return)"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$string"/> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet> 1.1 xml-cocoon2/src/webapp/samples/common/style/xsl/html/profile2html.xsl Index: profile2html.xsl =================================================================== <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:profile="http://apache.org/cocoon/profiler/1.0"> <xsl:param name="sort"/> <xsl:template match="profile:profilerinfo"> <html> <head> <title>Cocoon2 profile information [<xsl:value-of select="@profile:date"/>]</title> </head> <body> Sort results by <a href="?sort=uri">uri</a>, <a href="?sort=count">count</a>, <a href="?sort=time">time</a>. <table noshade="noshade" border="0" cellspacing="1" cellpadding="0" width="100%"> <xsl:choose> <xsl:when test="$sort = 'uri'"> <xsl:apply-templates> <xsl:sort select="@profile:uri"/> </xsl:apply-templates> </xsl:when> <xsl:when test="$sort = 'time'"> <xsl:apply-templates> <xsl:sort select="@profile:time" data-type="number"/> </xsl:apply-templates> </xsl:when> <xsl:when test="$sort = 'count'"> <xsl:apply-templates> <xsl:sort select="@profile:count" data-type="number"/> </xsl:apply-templates> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> </table> </body> </html> </xsl:template> <xsl:template match="profile:pipeline"> <xsl:if test="position() mod 5 = 1"> <tr bgcolor="#FFC0C0"> <th>NN</th> <th>Role (Source)</th> <th>Average</th> <th colspan="10">Last Results</th> </tr> </xsl:if> <tr bgcolor="#C0C0FF"> <td colspan="14"> <font face="verdana"><strong><xsl:value-of select="@profile:uri"/></strong></font> (<xsl:value-of select="@profile:count"/> results, total time: <xsl:value-of select="@profile:time"/>, average time: <xsl:value-of select="@profile:time div @profile:count"/>) </td> </tr> <!-- <xsl:for-each select="*"> <tr> <td> <xsl:apply-templates select="."/> </td> </tr> </xsl:for-each> --> <xsl:for-each select="profile:average/profile:element"> <xsl:variable name="bgcolor"> <xsl:if test="position() mod 2 = 0">#D0D0D0</xsl:if> <xsl:if test="position() mod 2 = 1">#E0E0E0</xsl:if> </xsl:variable> <tr bgcolor="{$bgcolor}"> <xsl:variable name="pos" select="position()"/> <td width="1%"> <xsl:value-of select="$pos"/> </td> <td width="10%"> <xsl:value-of select="@profile:role"/> <xsl:if test="@profile:source"> (<xsl:value-of select="@profile:source"/>) </xsl:if> </td> <xsl:for-each select="../../profile:average/profile:element[position()=$pos]"> <th> <xsl:value-of select="@profile:time"/> </th> </xsl:for-each> <xsl:for-each select="../../profile:result/profile:element[position()=$pos]"> <td> <xsl:value-of select="@profile:time"/> </td> </xsl:for-each> </tr> </xsl:for-each> <xsl:variable name="pos" select="count(profile:average/profile:element)"/> <tr> <td width="1%"> <xsl:value-of select="$pos+1"/> </td> <td width="10%"> TOTAL </td> <th> <xsl:value-of select="profile:average/@profile:time"/> </th> <xsl:for-each select="profile:result"> <td> <xsl:value-of select="@profile:time"/> </td> </xsl:for-each> </tr> </xsl:template> <xsl:template match="profile:average|profile:result"> <xsl:apply-templates/> </xsl:template> <xsl:template match="profile:element"> <table cellspacing="0" cellpadding="0"> <tr> <td> <xsl:value-of select="@profile:role"/> </td> </tr> </table> </xsl:template> </xsl:stylesheet> 1.1 xml-cocoon2/src/webapp/samples/common/style/xsl/html/simple-samples2html.xsl Index: simple-samples2html.xsl =================================================================== <?xml version="1.0"?> <!-- Author: Nicola Ken Barozzi "[EMAIL PROTECTED]" --> <!-- Author: Vadim Gritsenko "[EMAIL PROTECTED]" --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink"> <xsl:template match="/"> <html> <head> <title>Apache Cocoon 2.0.2-dev</title> <link rel="SHORTCUT ICON" href="favicon.ico"/> </head> <body bgcolor="#ffffff" link="#0086b2" vlink="#00698c" alink="#743e75"> <table border="0" cellspacing="2" cellpadding="2" align="center" width="100%"> <tr> <td width="*"><font face="arial,helvetica,sanserif" color="#000000">The Apache Software Foundation is proud to present...</font></td> <td width="40%" align="center"><img border="0" src="images/cocoon.gif"/></td> <td width="30%" align="center"><font face="arial,helvetica,sanserif" color="#000000"><b>version 2.0.2-dev</b></font></td> </tr> <tr> <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%"> <tr> <td width="90%" align="right" bgcolor="#0086b2"><i>orthogonal views: </i></td> <td nowrap="nowrap" bgcolor="#ffffff"><a href="?cocoon-view=content"><i>content</i></a></td> <td nowrap="nowrap" bgcolor="#ffffff"><a href="?cocoon-view=pretty-content"><i>pretty content</i></a></td> <td nowrap="nowrap" bgcolor="#ffffff"><a href="?cocoon-view=links"><i>links</i></a></td> </tr> </table> </tr> </table> <xsl:apply-templates select="samples"/> <p align="center"> <font size="-1"> Copyright © 1999-2002 <a href="http://www.apache.org/">The Apache Software Foundation</a>.<br/> All rights reserved. </font> </p> </body> </html> </xsl:template> <xsl:template match="samples"> <xsl:variable name="all-samples" select="count(group/sample)"/> <xsl:variable name="half-samples" select="round($all-samples div 2)"/> <xsl:variable name="half-possibilities"> <xsl:for-each select="group"> <xsl:if test="position() < last() and position() >= 1"> <xsl:variable name="group-position" select="position()"/> <xsl:variable name="prev-sample" select="count(../group[position() <= $group-position - 1]/sample)"/> <xsl:variable name="curr-sample" select="count(../group[position() <= $group-position]/sample)"/> <xsl:variable name="next-sample" select="count(../group[position() <= $group-position + 1]/sample)"/> <xsl:variable name="prev-deviation"> <xsl:choose> <xsl:when test="$prev-sample > $half-samples"> <xsl:value-of select="$prev-sample - $half-samples"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$half-samples - $prev-sample"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="curr-deviation"> <xsl:choose> <xsl:when test="$curr-sample > $half-samples"> <xsl:value-of select="$curr-sample - $half-samples"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$half-samples - $curr-sample"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="next-deviation"> <xsl:choose> <xsl:when test="$next-sample > $half-samples"> <xsl:value-of select="$next-sample - $half-samples"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$half-samples - $next-sample"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="$prev-deviation >= $curr-deviation and $curr-deviation <= $next-deviation"> <xsl:value-of select="$group-position"/><xsl:text> </xsl:text> </xsl:if> </xsl:if> </xsl:for-each> </xsl:variable> <xsl:variable name="half"> <xsl:value-of select="substring-before($half-possibilities, ' ')"/> </xsl:variable> <table width="100%"> <tr> <td width="50%" valign="top"> <xsl:for-each select="group"> <xsl:variable name="group-position" select="position()"/> <xsl:choose> <xsl:when test="$group-position <= $half"> <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%"> <tbody> <tr> <td> <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%"> <tr> <td bgcolor="#0086b2" width="100%" align="left"> <font size="+1" face="arial,helvetica,sanserif" color="#ffffff"><xsl:value-of select="@name"/></font> </td> </tr> <tr> <td width="100%" bgcolor="#ffffff" align="left"> <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center"> <xsl:apply-templates/> </table> </td> </tr> </table> </td> </tr> </tbody> </table> <br/> </xsl:when> <xsl:otherwise></xsl:otherwise> </xsl:choose> </xsl:for-each> </td> <td valign="top"> <xsl:for-each select="group"> <!-- [position()<=$half] --> <xsl:variable name="group-position" select="position()"/> <xsl:choose> <xsl:when test="$group-position > $half"> <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%"> <tbody> <tr> <td> <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%"> <tr> <td bgcolor="#0086b2" width="100%" align="left"> <font size="+1" face="arial,helvetica,sanserif" color="#ffffff"><xsl:value-of select="@name"/></font> </td> </tr> <tr> <td width="100%" bgcolor="#ffffff" align="left"> <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center"> <xsl:apply-templates/> </table> </td> </tr> </table> </td> </tr> </tbody> </table> <br/> </xsl:when> <xsl:otherwise></xsl:otherwise> </xsl:choose> </xsl:for-each> </td> </tr> </table> </xsl:template> <xsl:template match="sample"> <tr> <td width="100%" bgcolor="#ffffff" align="left"> <font size="+0" face="arial,helvetica,sanserif" color="#000000"> <a href="{@href}"><xsl:value-of select="@name"/></a><xsl:text> - </xsl:text> <xsl:value-of select="."/> </font> </td> </tr> </xsl:template> <xsl:template match="note"> <tr> <td width="100%" bgcolor="#ffffff" align="left"> <font size="+0" face="arial,helvetica,sanserif" color="#000000"> <xsl:value-of select="."/> </font> </td> </tr> </xsl:template> </xsl:stylesheet> 1.1 xml-cocoon2/src/webapp/samples/common/style/xsl/html/simple-sitemap2html.xsl Index: simple-sitemap2html.xsl =================================================================== <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:map="http://apache.org/cocoon/sitemap/1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <meta name="Author" content="{author}"/> <meta name="Version" content="{version}"/> <title>The Sitemap</title> <link rel="stylesheet" type="text/css" href="sitemap-style" title="Style"/> </head> <body bgcolor="white"> <xsl:apply-templates/> </body> </html> </xsl:template> <xsl:template match="map:sitemap"> <h1>The Sitemap</h1> <xsl:apply-templates/> </xsl:template> <xsl:template match="map:components"> <h2>Components</h2> <table border="0" width="100%" bgcolor="navy" cellspacing="0" cellpadding="0"> <tr> <td> <table border="0" width="100%" cellspacing="2" cellpadding="0"> <tr> <td bgcolor="lightgrey"> <table border="0" width="100%" cellspacing="2" cellpadding="0"> <xsl:apply-templates select="map:generators"/> <xsl:apply-templates select="map:transformers"/> <xsl:apply-templates select="map:readers"/> <xsl:apply-templates select="map:serializers"/> <xsl:apply-templates select="map:selectors"/> <xsl:apply-templates select="map:matchers"/> </table> </td> </tr> </table> </td> </tr> </table> </xsl:template> <xsl:template match="map:views"> <h2>Views</h2> <table border="0" width="100%" bgcolor="navy" cellspacing="0" cellpadding="0"> <tr> <td> <table border="0" width="100%" cellspacing="2" cellpadding="0"> <tr> <td bgcolor="lightgrey"> <table border="0" width="100%" cellspacing="2" cellpadding="0"> <tr> <td colspan="2" bgcolor="white"><b>Name</b></td> <td bgcolor="white"><b>Arguments</b></td> </tr> <xsl:apply-templates select="map:match|map:select|map:redirect-to|map:generate|map:transform|map:select|map:read"/> </table> </td> </tr> </table> </td> </tr> </table> </xsl:template> <xsl:template match="map:resources"> <h2>Resources</h2> <table border="0" width="100%" bgcolor="navy" cellspacing="0" cellpadding="0"> <tr> <td> <table border="0" width="100%" cellspacing="2" cellpadding="0"> <tr> <td bgcolor="lightgrey"> <table border="0" width="100%" cellspacing="2" cellpadding="0"> <tr> <td colspan="3" bgcolor="white"><b>Name</b></td> </tr> <xsl:apply-templates/> </table> </td> </tr> </table> </td> </tr> </table> </xsl:template> <xsl:template match="map:pipelines"> <h2>Pipelines</h2> <xsl:apply-templates/> </xsl:template> <xsl:template match="map:generators"> <xsl:call-template name="show-components"> <xsl:with-param name="type">Generators</xsl:with-param> <xsl:with-param name="comp-type">generator</xsl:with-param> <xsl:with-param name="default" select="@default"/> <xsl:with-param name="components" select="./*"/> <xsl:with-param name="label">true</xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template match="map:transformers"> <xsl:call-template name="break"/> <xsl:call-template name="show-components"> <xsl:with-param name="type">Transformers</xsl:with-param> <xsl:with-param name="comp-type">transformer</xsl:with-param> <xsl:with-param name="default" select="@default"/> <xsl:with-param name="components" select="./*"/> <xsl:with-param name="label">true</xsl:with-param> <xsl:with-param name="break">true</xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template match="map:readers"> <xsl:call-template name="break"/> <xsl:call-template name="show-components"> <xsl:with-param name="type">Readers</xsl:with-param> <xsl:with-param name="comp-type">reader</xsl:with-param> <xsl:with-param name="default" select="@default"/> <xsl:with-param name="components" select="./*"/> <xsl:with-param name="break">true</xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template match="map:serializers"> <xsl:call-template name="break"/> <xsl:call-template name="show-components"> <xsl:with-param name="type">Serializers</xsl:with-param> <xsl:with-param name="comp-type">serializer</xsl:with-param> <xsl:with-param name="default" select="@default"/> <xsl:with-param name="components" select="./*"/> <xsl:with-param name="break">true</xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template match="map:selectors"> <xsl:call-template name="break"/> <xsl:call-template name="show-components"> <xsl:with-param name="type">Selectors</xsl:with-param> <xsl:with-param name="comp-type">selector</xsl:with-param> <xsl:with-param name="default" select="@default"/> <xsl:with-param name="components" select="./*"/> <xsl:with-param name="break">true</xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template match="map:matchers"> <xsl:call-template name="break"/> <xsl:call-template name="show-components"> <xsl:with-param name="type">Matchers</xsl:with-param> <xsl:with-param name="comp-type">matcher</xsl:with-param> <xsl:with-param name="default" select="@default"/> <xsl:with-param name="components" select="./*"/> <xsl:with-param name="break">true</xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template match="map:view"> <xsl:if test="preceding-sibling::map:view"> <xsl:call-template name="break"/> </xsl:if> <tr> <td colspan="2" bgcolor="white"><a href=""><xsl:value-of select="@name"/></a></td> <td bgcolor="white">generate-from="<xsl:value-of select="@generate-from"/>"</td> </tr> <tr> <td bgcolor="white"> </td> <td colspan="2" bgcolor="white"> <xsl:apply-templates/> </td> </tr> </xsl:template> <xsl:template match="map:resource"> <xsl:if test="preceding-sibling::map:resource"> <xsl:call-template name="break"/> </xsl:if> <tr> <td colspan="3" bgcolor="white"><a href=""><xsl:value-of select="@name"/></a></td> </tr> <tr> <td bgcolor="white"> </td> <td colspan="2" bgcolor="white"> <xsl:apply-templates/> </td> </tr> </xsl:template> <xsl:template match="map:pipeline"> <table border="0" width="100%" bgcolor="navy" cellspacing="0" cellpadding="0"> <tr> <td> <table border="0" width="100%" cellspacing="2" cellpadding="0"> <tr> <td bgcolor="lightgrey"> <table border="0" width="100%" cellspacing="2" cellpadding="0"> <xsl:apply-templates/> </table> </td> </tr> </table> </td> </tr> </table> <br/> </xsl:template> <xsl:template match="map:match"> <xsl:choose> <xsl:when test="ancestor::*[self::map:pipeline]"> <tr> <td bgcolor="white"> <xsl:call-template name="indent"/> <a href="">match</a> <xsl:if test="@type"> type="<xsl:value-of select="@type"/>" </xsl:if> pattern="<xsl:value-of select="@pattern"/>" <br/> <xsl:apply-templates/> </td> </tr> </xsl:when> <xsl:otherwise> <xsl:call-template name="indent"/> <a href="">match</a> <xsl:if test="@type"> type="<xsl:value-of select="@type"/>" </xsl:if> pattern="<xsl:value-of select="@pattern"/>" <br/> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="map:select"> <xsl:call-template name="indent"/> <a href="">select</a> <xsl:if test="@type"> type="<xsl:value-of select="@type"/>" </xsl:if> <br/> <xsl:apply-templates/> </xsl:template> <xsl:template match="map:when"> <xsl:call-template name="indent"/> <a href="">when</a> test="<xsl:value-of select="@test"/>"<br/> <xsl:apply-templates/> </xsl:template> <xsl:template match="map:otherwise"> <xsl:call-template name="indent"/> <a href="">otherwise</a><br/> <xsl:apply-templates/> </xsl:template> <xsl:template match="map:generate"> <xsl:call-template name="indent"/> <a href="">generate</a> <xsl:if test="@type"> type="<xsl:value-of select="@type"/>" </xsl:if> src="<xsl:value-of select="@src"/>" <br/> <xsl:apply-templates/> </xsl:template> <xsl:template match="map:transform"> <xsl:call-template name="indent"/> <a href="">transform</a> <xsl:if test="@type"> type="<xsl:value-of select="@type"/>" </xsl:if> src="<xsl:value-of select="@src"/>" <br/> <xsl:apply-templates/> </xsl:template> <xsl:template match="map:read"> <xsl:call-template name="indent"/> <a href="">read</a> <xsl:if test="@type"> type="<xsl:value-of select="@type"/>" </xsl:if> src="<xsl:value-of select="@src"/>" <xsl:if test="@mime-type"> mime-type="<xsl:value-of select="@mime-type"/>" </xsl:if> <br/> <xsl:apply-templates/> </xsl:template> <xsl:template match="map:redirect-to"> <xsl:call-template name="indent"/> <a href="">redirect-to</a> <xsl:choose> <xsl:when test="@uri"> uri="<xsl:value-of select="@uri"/>" </xsl:when> <xsl:when test="@resource"> resource="<xsl:value-of select="@resource"/>" </xsl:when> </xsl:choose> <br/> <xsl:apply-templates/> </xsl:template> <xsl:template match="map:serialize"> <xsl:call-template name="indent"/> <a href="">serialize</a> <xsl:if test="@type"> type="<xsl:value-of select="@type"/>" </xsl:if> <xsl:if test="@mime-type"> mime-type="<xsl:value-of select="@mime-type"/>" </xsl:if> <br/> <xsl:apply-templates/> </xsl:template> <xsl:template match="map:mount"> <xsl:call-template name="indent"/> <a href="">mount</a> src="<xsl:value-of select="@src"/>" uri-prefix="<xsl:value-of select="@uri-prefix"/>"<br/> <xsl:if test="@check-reload"> check-reload="<xsl:value-of select="@check-reload"/>" </xsl:if> <br/> <xsl:apply-templates/> </xsl:template> <xsl:template match="map:handle-errors"> <tr> <td bgcolor="white"> <xsl:call-template name="indent"/> <a href="">handle-errors</a> <br/> <xsl:apply-templates/> </td> </tr> </xsl:template> <!-- named templates --> <xsl:template name="show-components"> <xsl:param name="type"/> <xsl:param name="comp-type"/> <xsl:param name="default"/> <xsl:param name="components"/> <xsl:param name="label"/> <tr> <td colspan="3" bgcolor="white"> <span class="h3"><xsl:value-of select="$type"/> (default=<i><xsl:value-of select="$default"/></i>)</span> </td> </tr> <tr> <td bgcolor="white"><b>Name</b></td> <xsl:choose> <xsl:when test="$label"> <td bgcolor="white"><b>Class</b></td> <td bgcolor="white"><b>Label</b></td> </xsl:when> <xsl:otherwise> <td colspan="2" bgcolor="white"><b>Class</b></td> </xsl:otherwise> </xsl:choose> </tr> <xsl:for-each select="$components"> <tr> <td bgcolor="white"><a href="sitemap-component?component={$comp-type}&name={@name}"><xsl:value-of select="@name"/></a></td> <xsl:choose> <xsl:when test="$label"> <xsl:choose> <xsl:when test="@src"> <td bgcolor="white"><xsl:value-of select="@src"/></td> </xsl:when> <xsl:otherwise> <td bgcolor="white"><i><xsl:value-of select="@factory"/></i></td> </xsl:otherwise> </xsl:choose> <td bgcolor="white"><xsl:value-of select="@label"/> </td> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="@src"> <td colspan="2" bgcolor="white"><xsl:value-of select="@src"/></td> </xsl:when> <xsl:otherwise> <td colspan="2" bgcolor="white"><i><xsl:value-of select="@factory"/></i></td> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </tr> <xsl:if test="./*"> <!-- <xsl:call-template name="show-config"/> --> </xsl:if> </xsl:for-each> </xsl:template> <xsl:template name="show-config"> <xsl:param name="indent"/> <xsl:choose> <xsl:when test="string-length($indent)=0"> <tr> <td align="right">Configuration</td> <td colspan="3"> <xsl:for-each select="./*">  <xsl:value-of select="name()"/> <xsl:if test="./*"> <xsl:call-template name="show-config"> <xsl:with-param name="indent"> <xsl:value-of select="$indent"/></xsl:with-param> </xsl:call-template> </xsl:if> </xsl:for-each> </td> </tr> </xsl:when> <xsl:otherwise> <tr> <td align="right"> </td> <td colspan="3"> <xsl:for-each select="./*">  <xsl:value-of select="name()"/>=<xsl:value-of select="@map:value"/><xsl:value-of select="text()"/> <xsl:if test="./*"> <xsl:call-template name="show-config"> <xsl:with-param name="indent"> <xsl:value-of select="$indent"/></xsl:with-param> </xsl:call-template> </xsl:if> </xsl:for-each> </td> </tr> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="break"> <tr> <td colspan="3" bgcolor="white"><hr color="navy"/></td> </tr> </xsl:template> <xsl:template name="indent"> <xsl:for-each select="ancestor::*"> <xsl:choose> <xsl:when test="local-name(.)='pipeline'"> </xsl:when> <xsl:when test="local-name(.)='pipelines'"> </xsl:when> <xsl:when test="local-name(.)='sitemap'"> </xsl:when> <xsl:when test="local-name(.)='resource'"> </xsl:when> <xsl:when test="local-name(.)='resources'"> </xsl:when> <xsl:when test="local-name(.)='view'"> </xsl:when> <xsl:when test="local-name(.)='views'"> </xsl:when> <xsl:otherwise>    </xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:template> <xsl:template match="*|@*|text()|comment()|processing-instruction()" priority="-1"/> </xsl:stylesheet> 1.1 xml-cocoon2/src/webapp/samples/common/style/xsl/html/simple-xml2html.xsl Index: simple-xml2html.xsl =================================================================== <!-- | | XSLT REC Compliant Version of IE5 Default Stylesheet | | Original version by Jonathan Marsh ([EMAIL PROTECTED]) | http://msdn.microsoft.com/xml/samples/defaultss/defaultss.xsl | | Conversion to XSLT 1.0 REC Syntax by Steve Muench ([EMAIL PROTECTED]) | +--> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="no" method="html"/> <xsl:template match="/"> <HTML> <HEAD> <SCRIPT> <xsl:comment><![CDATA[ function f(e){ if (e.className=="ci") { if (e.children(0).innerText.indexOf("\n")>0) fix(e,"cb"); } if (e.className=="di") { if (e.children(0).innerText.indexOf("\n")>0) fix(e,"db"); } e.id=""; } function fix(e,cl){ e.className=cl; e.style.display="block"; j=e.parentElement.children(0); j.className="c"; k=j.children(0); k.style.visibility="visible"; k.href="#"; } function ch(e) { mark=e.children(0).children(0); if (mark.innerText=="+") { mark.innerText="-"; for (var i=1;i<e.children.length;i++) { e.children(i).style.display="block"; } } else if (mark.innerText=="-") { mark.innerText="+"; for (var i=1;i<e.children.length;i++) { e.children(i).style.display="none"; } } } function ch2(e) { mark=e.children(0).children(0); contents=e.children(1); if (mark.innerText=="+") { mark.innerText="-"; if (contents.className=="db"||contents.className=="cb") { contents.style.display="block"; } else { contents.style.display="inline"; } } else if (mark.innerText=="-") { mark.innerText="+"; contents.style.display="none"; } } function cl() { e=window.event.srcElement; if (e.className!="c") { e=e.parentElement; if (e.className!="c") { return; } } e=e.parentElement; if (e.className=="e") { ch(e); } if (e.className=="k") { ch2(e); } } function ex(){} function h(){window.status=" ";} document.onclick=cl; ]]> </xsl:comment> </SCRIPT> <STYLE> BODY {font:x-small 'Verdana'; margin-right:1.5em} .c {cursor:hand} .b {color:red; font-family:'Courier New'; font-weight:bold; text-decoration:none} .e {margin-left:1em; text-indent:-1em; margin-right:1em} .k {margin-left:1em; text-indent:-1em; margin-right:1em} .t {color:#990000} .xt {color:#990099} .ns {color:red} .dt {color:green} .m {color:blue} .tx {font-weight:bold} .db {text-indent:0px; margin-left:1em; margin-top:0px; margin-bottom:0px;padding-left:.3em; border-left:1px solid #CCCCCC; font:small Courier} .di {font:small Courier} .d {color:blue} .pi {color:blue} .cb {text-indent:0px; margin-left:1em; margin-top:0px; margin-bottom:0px;padding-left:.3em; font:small Courier; color:#888888} .ci {font:small Courier; color:#888888} PRE {margin:0px; display:inline} </STYLE> </HEAD> <BODY class="st"> <xsl:apply-templates/> </BODY> </HTML> </xsl:template> <xsl:template match="processing-instruction()"> <DIV class="e"> <SPAN class="b"> <xsl:call-template name="nbsp-ref"/> </SPAN> <SPAN class="m"> <xsl:text><?</xsl:text> </SPAN> <SPAN class="pi"> <xsl:value-of select="name(.)"/> <xsl:value-of select="."/> </SPAN> <SPAN class="m"> <xsl:text>?></xsl:text> </SPAN> </DIV> </xsl:template> <xsl:template match="processing-instruction('xml')"> <DIV class="e"> <SPAN class="b"> <xsl:call-template name="nbsp-ref"/> </SPAN> <SPAN class="m"> <xsl:text><?</xsl:text> </SPAN> <SPAN class="pi"> <xsl:text>xml </xsl:text> <xsl:for-each select="@*"> <xsl:value-of select="name(.)"/> <xsl:text>="</xsl:text> <xsl:value-of select="."/> <xsl:text>" </xsl:text> </xsl:for-each> </SPAN> <SPAN class="m"> <xsl:text>?></xsl:text> </SPAN> </DIV> </xsl:template> <xsl:template match="@*"> <SPAN> <xsl:attribute name="class"> <xsl:if test="xsl:*/@*"> <xsl:text>x</xsl:text> </xsl:if> <xsl:text>t</xsl:text> </xsl:attribute> <xsl:value-of select="name(.)"/> </SPAN> <SPAN class="m">="</SPAN> <B> <xsl:value-of select="."/> </B> <SPAN class="m">"</SPAN> </xsl:template> <xsl:template match="text()"> <DIV class="e"> <SPAN class="b"> </SPAN> <SPAN class="tx"> <xsl:value-of select="."/> </SPAN> </DIV> </xsl:template> <xsl:template match="comment()"> <DIV class="k"> <SPAN> <A STYLE="visibility:hidden" class="b" onclick="return false" onfocus="h()">-</A> <SPAN class="m"> <xsl:text><!--</xsl:text> </SPAN> </SPAN> <SPAN class="ci" id="clean"> <PRE> <xsl:value-of select="."/> </PRE> </SPAN> <SPAN class="b"> <xsl:call-template name="nbsp-ref"/> </SPAN> <SPAN class="m"> <xsl:text>--></xsl:text> </SPAN> <SCRIPT>f(clean);</SCRIPT> </DIV> </xsl:template> <xsl:template match="*"> <DIV class="e"> <DIV STYLE="margin-left:1em;text-indent:-2em"> <SPAN class="b"> <xsl:call-template name="nbsp-ref"/> </SPAN> <SPAN class="m"><</SPAN> <SPAN> <xsl:attribute name="class"> <xsl:if test="xsl:*"> <xsl:text>x</xsl:text> </xsl:if> <xsl:text>t</xsl:text> </xsl:attribute> <xsl:value-of select="name(.)"/> <xsl:if test="@*"> <xsl:text> </xsl:text> </xsl:if> </SPAN> <xsl:apply-templates select="@*"/> <SPAN class="m"> <xsl:text>/></xsl:text> </SPAN> </DIV> </DIV> </xsl:template> <xsl:template match="*[node()]"> <DIV class="e"> <DIV class="c"> <A class="b" href="#" onclick="return false" onfocus="h()">-</A> <SPAN class="m"><</SPAN> <SPAN> <xsl:attribute name="class"> <xsl:if test="xsl:*"> <xsl:text>x</xsl:text> </xsl:if> <xsl:text>t</xsl:text> </xsl:attribute> <xsl:value-of select="name(.)"/> <xsl:if test="@*"> <xsl:text> </xsl:text> </xsl:if> </SPAN> <xsl:apply-templates select="@*"/> <SPAN class="m"> <xsl:text>></xsl:text> </SPAN> </DIV> <DIV> <xsl:apply-templates/> <DIV> <SPAN class="b"> <xsl:call-template name="nbsp-ref"/> </SPAN> <SPAN class="m"> <xsl:text></</xsl:text> </SPAN> <SPAN> <xsl:attribute name="class"> <xsl:if test="xsl:*"> <xsl:text>x</xsl:text> </xsl:if> <xsl:text>t</xsl:text> </xsl:attribute> <xsl:value-of select="name(.)"/> </SPAN> <SPAN class="m"> <xsl:text>></xsl:text> </SPAN> </DIV> </DIV> </DIV> </xsl:template> <xsl:template match="*[text() and not (comment() or processing-instruction())]"> <DIV class="e"> <DIV STYLE="margin-left:1em;text-indent:-2em"> <SPAN class="b"> <xsl:call-template name="nbsp-ref"/> </SPAN> <SPAN class="m"> <xsl:text><</xsl:text> </SPAN> <SPAN> <xsl:attribute name="class"> <xsl:if test="xsl:*"> <xsl:text>x</xsl:text> </xsl:if> <xsl:text>t</xsl:text> </xsl:attribute> <xsl:value-of select="name(.)"/> <xsl:if test="@*"> <xsl:text> </xsl:text> </xsl:if> </SPAN> <xsl:apply-templates select="@*"/> <SPAN class="m"> <xsl:text>></xsl:text> </SPAN> <SPAN class="tx"> <xsl:value-of select="."/> </SPAN> <SPAN class="m"></</SPAN> <SPAN> <xsl:attribute name="class"> <xsl:if test="xsl:*"> <xsl:text>x</xsl:text> </xsl:if> <xsl:text>t</xsl:text> </xsl:attribute> <xsl:value-of select="name(.)"/> </SPAN> <SPAN class="m"> <xsl:text>></xsl:text> </SPAN> </DIV> </DIV> </xsl:template> <xsl:template match="*[*]" priority="20"> <DIV class="e"> <DIV STYLE="margin-left:1em;text-indent:-2em" class="c"> <A class="b" href="#" onclick="return false" onfocus="h()">-</A> <SPAN class="m"><</SPAN> <SPAN> <xsl:attribute name="class"> <xsl:if test="xsl:*"> <xsl:text>x</xsl:text> </xsl:if> <xsl:text>t</xsl:text> </xsl:attribute> <xsl:value-of select="name(.)"/> <xsl:if test="@*"> <xsl:text> </xsl:text> </xsl:if> </SPAN> <xsl:apply-templates select="@*"/> <SPAN class="m"> <xsl:text>></xsl:text> </SPAN> </DIV> <DIV> <xsl:apply-templates/> <DIV> <SPAN class="b"> <xsl:call-template name="nbsp-ref"/> </SPAN> <SPAN class="m"> <xsl:text></</xsl:text> </SPAN> <SPAN> <xsl:attribute name="class"> <xsl:if test="xsl:*"> <xsl:text>x</xsl:text> </xsl:if> <xsl:text>t</xsl:text> </xsl:attribute> <xsl:value-of select="name(.)"/> </SPAN> <SPAN class="m"> <xsl:text>></xsl:text> </SPAN> </DIV> </DIV> </DIV> </xsl:template> <xsl:template name="nbsp-ref"> <xsl:text> </xsl:text> </xsl:template> </xsl:stylesheet>
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]