Difference between revisions of "XSL Template"

From SmartWiki
Jump to: navigation, search
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
<table class="wikitable"><tr><td style="padding: 10px;"><big>This page has been deprecated</big></td><td style="padding: 10px;">See [[Custom Field Type: Special - XML Data]]</td></tr></table>
 +
 +
==Overview==
 +
 
The ''XSL Template'' setting on an {{XML}} works in conjunction with the [[XML Section Builder]] to define how the XML worksheet is displayed.  
 
The ''XSL Template'' setting on an {{XML}} works in conjunction with the [[XML Section Builder]] to define how the XML worksheet is displayed.  
 +
''XSL'' stands for ''Extensible Stylesheet Language''.
  
[[Image:SampleXSLTemplate.png|link=|500px]]
+
==XSL Template Field Illustrated==
 +
[[Image:SampleXSLTemplate.png|link=|650px]]
  
''XSL'' stands for ''Extensible Stylesheet Language''.
 
  
An example XSL Template would be as follows:
+
==Example Template==
 +
 
 +
An example of an [[Accessibility_legislation|Accessible]] XSL Template would be as follows:
  
 
<pre style="white-space: pre-wrap;  
 
<pre style="white-space: pre-wrap;  
Line 11: Line 18:
 
  white-space: -pre-wrap;  
 
  white-space: -pre-wrap;  
 
  white-space: -o-pre-wrap;  
 
  white-space: -o-pre-wrap;  
  word-wrap: break-word;"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
  word-wrap: break-word;">
 
 
<html xmlns="http://www.w3.org/1999/xhtml">
 
  
 +
<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 +
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
<head>
 
<head>
 
 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
+
<title>XML worksheet title</title>
<title>Worksheet Title</title>
 
 
 
 
<style type="text/css">
 
<style type="text/css">
 
...define your styles here...
 
...define your styles here...
Line 44: Line 48:
 
</html></pre>
 
</html></pre>
  
 +
The references to '''@section.''section name''@''' refer to the sections defined in the [[XML Section Builder|Section Builder]].
 +
 +
For example, the following ''XSL Template'':
 +
 +
[[Image:XMLExampleXSLTemplate.png|link=|500px]]
 +
 +
...will display the ''Revenue'' and ''Expenses'' sections accordingly when the {{XML}} is opened on a record:
 +
 +
[[Image:SampleXSLTemplateDisplay.png|link=|500px]]
  
[[Category:XML]]
+
==See Also==
 +
* [[XML Section Builder]]
 +
* {{XML}}
 +
* [[Adding Styles to XML Worksheets]]
 +
* [[Accessibility_legislation]]

Latest revision as of 16:38, 19 December 2016

This page has been deprecatedSee Custom Field Type: Special - XML Data

Overview

The XSL Template setting on an XML custom field works in conjunction with the XML Section Builder to define how the XML worksheet is displayed. XSL stands for Extensible Stylesheet Language.

XSL Template Field Illustrated

SampleXSLTemplate.png


Example Template

An example of an Accessible XSL Template would be as follows:


<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>XML worksheet title</title>
<style type="text/css">
...define your styles here...
</style>

</head>

<body>

<table>
<tr>
<td>@section.Revenue-Cash@</td>
</tr>
<tr>
<td>@section.Revenue-Funding@</td>
</tr>
<tr>
<td>@section.Revenue-Total@</td>
</tr>
</table>

</body>
</html>

The references to @section.section name@ refer to the sections defined in the Section Builder.

For example, the following XSL Template:

XMLExampleXSLTemplate.png

...will display the Revenue and Expenses sections accordingly when the XML custom field is opened on a record:

SampleXSLTemplateDisplay.png

See Also