Click here to Skip to main content
15,891,253 members
Articles / Programming Languages / XML

Self documenting XSLTs

Rate me:
Please Sign up or sign in to vote.
3.50/5 (8 votes)
18 Jun 20032 min read 56.5K   635   25  
Make your XSLTs self documenting
<?xml version="1.0" encoding="ISO-8859-1"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:focas="http://www.focas.edu.au/xslt/documentation"><head><title>Xsl documentor</title><style>
			
			body {
				font-weight:normal;
				font-size: 68%;
				font-family: verdana,arial,helvetica;
				color:#000000;
			}
			
			td {
				FONT-SIZE: 68%;
				padding: 5px;
			}
			p {
				line-height:1.5em;
				margin-top:0.5em; 
				margin-bottom:1.0em;
			}
			h1 {
				MARGIN: 0px 0px 5px; 
				FONT: 165% verdana,arial,helvetica;
			}
			h2 {
				MARGIN-TOP: 1em; 
				MARGIN-BOTTOM: 0.5em; 
				FONT: bold 125% verdana,arial,helvetica;
			}
			h3 {
				MARGIN-BOTTOM: 0.5em; 
				FONT: bold 115% verdana,arial,helvetica;
			}
			h4 {
				MARGIN-BOTTOM: 0.5em; 
				FONT: bold 100% verdana,arial,helvetica;
			}
			h5 {
				MARGIN-BOTTOM: 0.5em; 
				FONT: bold 100% verdana,arial,helvetica
			}
			h6 {
				MARGIN-BOTTOM: 0.5em; 
				FONT: bold 100% verdana,arial,helvetica
			}	
			.Note {
				font-weight:bold; 
				background:#ddd; 
				color:purple;
				font-style: italic;
			}
			.Failure {
				font-weight:bold; 
				background:#ddd;
				color:red;
			}
			.FailureDetail {
				font-size: -1;
				padding-left: 2.0em;
				background:#eeeee0;
			}
			.Pass {
				background:#ddd;
				padding-left:2px;
			}
			.TableHeader {
				background: #888;
				color: white;
				font-weight: bold;
				horizontal-align: center;
			}
			.EnvInfoHeader {
				background: #888;
				color: white;
				font-weight: bold;
				horizontal-align: center;
			}
			.EnvInfoRow {
				background:#eeeee0;
			}
			a:visited {
				color: #0000ff;
			}
			a {
				color: #0000ff;
			}
			a:active {
				color: #800000;
			}
			a.summarie {
				color:#000;
				font-family:Webdings;
				text-decoration: none;
				font-size:140%;
			}
			a.summarie:active {
				color:#000;
				font-family:Webdings;
				text-decoration: none;
				font-size:140%;
			}
			a.summarie:visited {
				color:#000;
				font-family:Webdings;
				text-decoration: none;
				font-size:140%;
			}
			.description {
				padding:3px;
				background-color:#cccccc;
				color:#000;
				font-weight:normal;
			}
			.method{
				color:#000;
				font-weight:normal;
				padding-left:5px;
			}
			a.method{
				text-decoration: none;
				color:#000;
				font-weight:normal;
				padding-left:5px;
			}
			a.Failure {
				font-weight:bold; 
				color:red;
				text-decoration: none;
			}
			a.Failure:visited {
				font-weight:bold; 
				color:red;
				text-decoration: none;
			}
			a.Failure:active {
				font-weight:bold; 
				color:red;
				text-decoration: none;
			}
			a.error {
				font-weight:bold; 
				color:red;
				text-decoration: none;
				padding-left:5px;
			}
			a.error:visited {
				font-weight:bold; 
				color:red;
				text-decoration: none;
				padding-left:5px;
			}
			a.error:active {
				font-weight:bold; 
				color:red;
				text-decoration: none;
				padding-left:5px;
			}
		</style></head><body text="#000000" bgColor="#ffffff"><a name="top"/><h1>CD Output Master XSLT</h1><p>Auto generated by xsltDocumentor.xsl</p><hr/><h3>System Information</h3><table border="0"><tr><td class="TableHeader">System</td><td class="pass">CD Output Master XSLT</td></tr><tr><td class="TableHeader">Description</td><td class="pass">Imports all necessary sheets, and Project specific variables are set here</td></tr><tr><td class="TableHeader">File</td><td class="pass">$Source: o:\\cvs_tol_repository/publishing/cdspecific/cd.xsl,v $</td></tr><tr><td class="TableHeader">Author</td><td class="pass">Mark Focas</td></tr><tr><td class="TableHeader">Version</td><td class="pass">$Revision: 1.2 $</td></tr><tr><td class="TableHeader">Date</td><td class="pass">6 June 2003</td></tr><tr><td class="TableHeader">Last modified</td><td class="pass">$Date: 2003/06/13 05:50:07 $</td></tr></table><h3>Revision History</h3><table border="0"><tr class="tableHeader"><td>Date</td><td>Author</td><td>Comment</td><tr class="pass"><td>10 June 2003</td><td>Mark Focas</td><td>Added menu variables</td></tr><tr class="pass"><td>12 June 2003</td><td>Mark Focas</td><td>Another lang attribute</td></tr></tr></table><h3>Notes</h3><h4>Note [13 June 2003]</h4>
	        This XSLT is part of a suite of XSLT's to transform the XML files  based on a mapping file<br xmlns="http://www.w3.org/TR/REC-html4/strict.dtd" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
	        <strong xmlns="http://www.w3.org/TR/REC-html4/strict.dtd" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Output format: </strong>CD Rom
	       <br/><hr/><h3>dependant Imported files</h3><table border="0"><tr class="pass"><td class="method"><a href="cd_project_specific.xsl.htm">cd_project_specific.xsl</a></td></tr><tr class="pass"><td class="method"><a href="project_specific.xsl.htm">project_specific.xsl</a></td></tr></table><h3>Global variables</h3><table><tr><td class="TableHeader">name</td><td class="TableHeader">value</td><td class="TableHeader">comment</td></tr><tr class="pass"><td>CD.MENU.NORMAL.COLOR</td><td>#FFFFFF</td><td>The standard menu items text colour</td></tr><tr class="pass"><td>CD.MENU.TITLE.COLOR</td><td>#FFFFFF</td><td>The standard menu title text colour</td></tr><tr class="pass"><td>CD.MENU.BACK.COLOR</td><td>#336699</td><td>The standard menu background colour</td></tr><tr class="pass"><td>CD.MENU.LASTVISIT.COLOR</td><td>#FFFFBB</td><td>The menu items last visited text colour for links</td></tr><tr class="pass"><td>CD.MENU.CURRENT.COLOR</td><td>#FFFF66</td><td>The currently selected menu items text colour for links</td></tr><tr class="pass"><td>CD.MENU.MLEVEL</td><td>0</td><td>God knows what this is, but he wasn't answering calls when we tried</td></tr><tr class="pass"><td>CD.MENU.FONT.TITLE</td><td>Helvetica,Arial</td><td>The standard menus Title font</td></tr><tr class="pass"><td>CD.MENU.FONT.LINES</td><td>Helvetica,Arial</td><td>refer to MLevel</td></tr><tr class="pass"><td>CD.MENU.SHOWNUMBERS</td><td>false</td><td>Display menu level numbers for each item</td></tr></table><table border="0" style="width: 95%"><tr><td><a name="#"/>
			Template</td><td style="text-align: right"><a href="#top">Top</a></td><td style="width:33%"/></tr><tr><td>Matches</td><td class="Note" style="text-align: left">"/"</td><td style="width:33%"/></tr><tr><td colspan="3"><hr/></td></tr></table><table border="0" style="width: 95%"><tr><td><a name="#"/>
			Template</td><td style="text-align: right"><a href="#top">Top</a></td><td style="width:33%"/></tr><tr><td>Matches</td><td class="Note" style="text-align: left">"//content[1]"</td><td style="width:33%"/></tr><tr><td colspan="3">Creates the HTML shell for the page, and calls the pageContainer template in the utilities stylesheet to populate the page                                 The headElement template in the head stylesheet is called, and populates the ead with CD Rom output specific support files</td></tr><tr><td style="widt:33%">
				calls <a href="#head.headElement">head.headElement</a></td><td style="widt:33%"/></tr><tr><td style="widt:33%">
				calls <a href="#utilities.bodyAttributes">utilities.bodyAttributes</a></td><td style="widt:33%"/></tr><tr><td style="widt:33%">
				calls <a href="#utilities.pageContainer">utilities.pageContainer</a></td><td style="widt:33%"/></tr><tr><td colspan="3"><hr/></td></tr></table><table border="0" style="width: 95%"><tr><td><a name="#test"/>
			Template</td><td style="text-align: right"><a href="#top">Top</a></td><td style="width:33%"/></tr><tr><td>Name</td><td class="Note">test</td><td style="width:33%"/></tr><tr><td colspan="3">this template exists only to show how a named template appears, and vaiables and paramaters in that template</td></tr><tr><td>parameter</td><td>testParam</td><td/><td/><td/></tr><tr><td>variable</td><td>test
				 = 
				someNode</td><td/><td/></tr><tr><td colspan="3"><hr/></td></tr></table></body></html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Australia Australia
Working in the educational arena, automating publishing processes, developing a single XML source, multiple output format publishing solution for a distributed environment
http://blog.focas.net.au

Comments and Discussions