| <?xml version="1.0" encoding="UTF-8"?> | |
| <!-- | |
| Copyright 2002-2005 The Apache Software Foundation or its licensors, | |
| as applicable. | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software | |
| distributed under the License is distributed on an "AS IS" BASIS, | |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| See the License for the specific language governing permissions and | |
| limitations under the License. | |
| --> | |
| <forrest:contract name="content-source-xml-link" type="nugget" | |
| xmlns:forrest="http://apache.org/forrest/templates/1.0"> | |
| <description> | |
| content-source-xml-link will output the XML link with image to the | |
| original source content of the document. Input plugins should provide | |
| the ability to retrieve the original source XML by making a request for | |
| *.source.xml, this contract provides a link to that file. If you want to | |
| provide a link to the XDoc format of the content use the | |
| content-xml-link template. | |
| </description> | |
| <usage><![CDATA[<forrest:contract name="content-source-xml-link"/>]]></usage> | |
| <forrest:template | |
| xmlns:forrest="http://apache.org/forrest/templates/1.0" | |
| format="html" name="content-source-xml-link" inputFormat="xsl" body="true"> | |
| <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
| <xsl:param name="defaultVariables" select="'test.html'"/> | |
| <xsl:variable name="skin-img-dir" | |
| select="$defaultVariables/*/*[@name='skin-img-dir']/@value"/> | |
| <xsl:variable name="filename-noext" | |
| select="$defaultVariables/*/*[@name='filename-noext']/@value"/> | |
| <xsl:template match="/"> | |
| <forrest:content> | |
| <forrest:part> | |
| <a href="{$filename-noext}.source.xml" class="format"> | |
| <img class="skin" src="{$skin-img-dir}/xmldoc.gif" | |
| alt="Source XML - icon" /> | |
| <span class="caption">Source XML</span> | |
| </a> | |
| </forrest:part> | |
| </forrest:content> | |
| </xsl:template> | |
| </xsl:stylesheet> | |
| </forrest:template> | |
| </forrest:contract> |