| <?xml version="1.0" encoding="UTF-8" ?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you 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. |
| |
| --> |
| <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
| <xsl:output method="xml" omit-xml-declaration="yes"/> |
| |
| <xsl:param name="arch.stylesheet"/> |
| <xsl:param name="arch.overviewlink"/> |
| <xsl:param name="arch.footer"/> |
| <xsl:param name="arch.target"/> |
| |
| <xsl:template match="/"> |
| <xsl:variable name="interfaces" select="//api[@type='export']" /> |
| |
| <module name="{api-answers/@module}" |
| target="{$arch.target}" |
| stylesheet="{$arch.stylesheet}" |
| overviewlink="{$arch.overviewlink}" |
| footer="{$arch.footer}"> |
| |
| <description> |
| <xsl:apply-templates select="api-answers/answer[@id='arch-what']/node()" mode="description"/> |
| </description> |
| |
| <xsl:variable name="deploy-dependencies" select="api-answers/answer[@id='deploy-dependencies']"/> |
| <xsl:if test="$deploy-dependencies"> |
| <deploy-dependencies> |
| <xsl:apply-templates select="$deploy-dependencies/node()"/> |
| </deploy-dependencies> |
| </xsl:if> |
| |
| <xsl:variable name="arch-usecases" select="api-answers/answer[@id='arch-usecases']"/> |
| <xsl:if test="$arch-usecases"> |
| <arch-usecases> |
| <xsl:apply-templates select="$arch-usecases/node()"/> |
| </arch-usecases> |
| </xsl:if> |
| |
| <xsl:for-each select="$interfaces"> |
| <xsl:call-template name="api" > |
| <xsl:with-param name="group" select="@group" /> |
| <xsl:with-param name="type" select="@type" /> |
| </xsl:call-template> |
| </xsl:for-each> |
| |
| </module> |
| </xsl:template> |
| |
| <xsl:template name="api"> |
| <xsl:param name="group" /> |
| <xsl:param name="type" /> |
| |
| <xsl:variable name="name" select="@name" /> |
| <xsl:variable name="category" select="@category" /> |
| <xsl:variable name="url" select="@url" /> |
| |
| <api name="{$name}" type="{$type}" category="{$category}"> |
| <xsl:if test="string-length($url)>0"><xsl:attribute name="url"><xsl:value-of select="$url" /></xsl:attribute> |
| </xsl:if> |
| <xsl:choose > |
| <xsl:when test="$group"><xsl:attribute name="group"><xsl:value-of select="$group" /></xsl:attribute></xsl:when> |
| <xsl:otherwise><xsl:attribute name="group">java</xsl:attribute></xsl:otherwise> |
| </xsl:choose> |
| |
| <xsl:apply-templates /> |
| </api> |
| </xsl:template> |
| |
| <xsl:template match="api" mode="description"> |
| <api-ref name="{@name}"/> |
| </xsl:template> |
| |
| <!-- Format random HTML elements as is: --> |
| <xsl:template match="@*|node()"> |
| <xsl:copy > |
| <xsl:apply-templates select="@*|node()"/> |
| </xsl:copy> |
| </xsl:template> |
| |
| </xsl:stylesheet> |