Patch submitted by : Lukas Theussl Patch reviewed by : Arnaud Heritier git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@278607 13f79535-47bb-0310-9956-ffa450edef68
104 lines
3.2 KiB
XML
104 lines
3.2 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<!--
|
|
* ========================================================================
|
|
*
|
|
* Copyright 2001-2005 The Apache Software Foundation.
|
|
*
|
|
* 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.
|
|
*
|
|
* ========================================================================
|
|
-->
|
|
<!-- stylesheet to be used -->
|
|
<jsl:stylesheet select="$doc"
|
|
xmlns:j="jelly:core"
|
|
xmlns:jsl="jelly:jsl"
|
|
xmlns:x="jelly:xml"
|
|
xmlns:doc="doc"
|
|
xmlns="dummy"
|
|
trim="true">
|
|
<jsl:template match="faqs" trim="false">
|
|
<j:set var="title"><x:expr select="@title" /></j:set>
|
|
<document>
|
|
<properties>
|
|
<title>${title}</title>
|
|
</properties>
|
|
<body>
|
|
<section name="${title}">
|
|
<x:forEach select="part">
|
|
<p>
|
|
<strong><x:expr select="title"/></strong>
|
|
</p>
|
|
<ol>
|
|
<x:forEach select="faq">
|
|
<li>
|
|
<j:set var="_id"><x:expr select="@id"/></j:set>
|
|
<j:set var="_id">#<doc:escapeNameToken value="${_id}"/></j:set>
|
|
<a href="${_id}">
|
|
<x:copyOf select="question/node()"/>
|
|
</a>
|
|
</li>
|
|
</x:forEach>
|
|
</ol>
|
|
</x:forEach>
|
|
</section>
|
|
<jsl:applyTemplates trim="true" />
|
|
</body>
|
|
</document>
|
|
</jsl:template>
|
|
|
|
<jsl:template match="part">
|
|
<j:set var="name"><x:expr select="title" /></j:set>
|
|
<section name="${name}">
|
|
<jsl:applyTemplates select="faq" trim="true" />
|
|
</section>
|
|
</jsl:template>
|
|
|
|
<jsl:template match="faq">
|
|
<dl>
|
|
<jsl:applyTemplates trim="true" />
|
|
</dl>
|
|
</jsl:template>
|
|
|
|
<jsl:template match="question">
|
|
<dt class="question">
|
|
<j:set var="_id"><x:expr select="../@id"/></j:set>
|
|
<j:set var="_id"><doc:escapeNameToken value="${_id}"/></j:set>
|
|
<a name="${_id}"/><jsl:applyTemplates trim="true" />
|
|
</dt>
|
|
</jsl:template>
|
|
|
|
<jsl:template match="answer">
|
|
<dd>
|
|
<jsl:applyTemplates trim="true" />
|
|
<j:if test="${context.getVariable('maven.faq.toplinks') == 'true'}">
|
|
<j:set var="top"><x:expr select="../../../@title"/></j:set>
|
|
<j:set var="_top">#<doc:escapeNameToken value="${top}"/></j:set>
|
|
<div class="xright"><a href="${_top}">[top]</a></div>
|
|
<br/>
|
|
</j:if>
|
|
</dd>
|
|
</jsl:template>
|
|
|
|
<!-- copy any other elements through -->
|
|
<jsl:template match="*" trim="false"><jsl:copy trim="true"><jsl:applyTemplates trim="true"/></jsl:copy></jsl:template>
|
|
|
|
<!-- element values don't pass through as text -->
|
|
<jsl:template match="@*"/>
|
|
|
|
<!-- CDATA and text nodes pass-thru -->
|
|
<jsl:template match="text()"><x:expr select="."/></jsl:template>
|
|
|
|
</jsl:stylesheet>
|
|
|