-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopenapi_xml.xslt
More file actions
35 lines (30 loc) · 912 Bytes
/
openapi_xml.xslt
File metadata and controls
35 lines (30 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output indent="true"/>
<xsl:strip-space elements="*"/>
<xsl:variable name="nl"><xsl:text>
</xsl:text></xsl:variable>
<xsl:template match="/">
<api>
<xsl:apply-templates select="//api_info"/>
<xsl:apply-templates select="//api_path"/>
</api>
</xsl:template>
<xsl:template match="api_info">
<info>
<xsl:copy-of select="./*"/>
</info>
</xsl:template>
<xsl:template match="api_path">
<xsl:element name="path">
<xsl:attribute name="path">
<xsl:value-of select="@path"/>
</xsl:attribute>
<xsl:apply-templates select="get"/>
</xsl:element>
</xsl:template>
<xsl:template match="api_path/get">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>