📄 wsdl-viewer.xsl
字号:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ws="http://schemas.xmlsoap.org/wsdl/"
xmlns:ws2="http://www.w3.org/ns/wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:local="http://tomi.vanek.sk/xml/wsdl-viewer" version="1.0"
exclude-result-prefixes="ws ws2 xsd soap local">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="no"
omit-xml-declaration="no" media-type="text/html"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
<xsl:strip-space elements="*" />
<xsl:param name="wsdl-viewer.version">3.1.00</xsl:param>
<!--
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Begin of included transformation: wsdl-viewer-global.xsl
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-->
<xsl:param name="ENABLE-SERVICE-PARAGRAPH" select="true()" />
<xsl:param name="ENABLE-OPERATIONS-PARAGRAPH" select="true()" />
<xsl:param name="ENABLE-SRC-CODE-PARAGRAPH" select="true()" />
<xsl:param name="ENABLE-ABOUT-PARAGRAPH" select="true()" />
<xsl:param name="ENABLE-OPERATIONS-TYPE" select="true()" />
<xsl:param name="ENABLE-LINK" select="true()" />
<xsl:param name="ENABLE-INOUTFAULT" select="true()" />
<xsl:param name="ENABLE-STYLEOPTYPEPATH" select="true()" />
<xsl:param name="ENABLE-DESCRIPTION" select="true()" />
<xsl:param name="ENABLE-PORTTYPE-NAME" select="true()" />
<xsl:param name="ENABLE-ANTIRECURSION-PROTECTION" select="true()" />
<xsl:param name="ANTIRECURSION-DEPTH">3</xsl:param>
<xsl:variable name="GENERATED-BY">
Generated by wsdl-viewer.xsl
</xsl:variable>
<xsl:variable name="PORT-TYPE-TEXT">Port type</xsl:variable>
<xsl:variable name="IFACE-TEXT">Interface</xsl:variable>
<xsl:variable name="SOURCE-CODE-TEXT">Source code</xsl:variable>
<xsl:variable name="RECURSIVE">... is recursive</xsl:variable>
<xsl:variable name="SRC-PREFIX">src.</xsl:variable>
<xsl:variable name="SRC-FILE-PREFIX">src.file.</xsl:variable>
<xsl:variable name="OPERATIONS-PREFIX">op.</xsl:variable>
<xsl:variable name="PORT-PREFIX">port.</xsl:variable>
<xsl:variable name="IFACE-PREFIX">iface.</xsl:variable>
<xsl:variable name="global.wsdl-name"
select="concat(/*/*[local-name() = 'import' and @location][1]/@location, /*/*[local-name() = 'include' and @location][1]/@location)" />
<xsl:variable name="consolidated-wsdl"
select="/*|document($global.wsdl-name)/*" />
<xsl:variable name="global.types"
select="$consolidated-wsdl/*[local-name() = 'types']" />
<xsl:variable name="global.xsd"
select="$global.types//xsd:import[@schemaLocation][1] | $global.types//xsd:include[@schemaLocation][1]" />
<xsl:variable name="global.xsd-name"
select="$global.xsd[1]/@schemaLocation" />
<xsl:variable name="consolidated-xsd.data"
select="document($global.xsd-name)/xsd:schema/xsd:*|/*/*[local-name() = 'types']/xsd:schema/xsd:*" />
<xsl:variable name="consolidated-xsd"
select="$consolidated-xsd.data[local-name() = 'complexType' or local-name() = 'element' or local-name() = 'simpleType']" />
<xsl:variable name="global.service-name"
select="concat($consolidated-wsdl/ws:service/@name, $consolidated-wsdl/ws2:service/@name)" />
<xsl:variable name="global.binding-name"
select="concat($consolidated-wsdl/ws:binding/@name, $consolidated-wsdl/ws2:binding/@name)" />
<xsl:variable name="html-title">
<xsl:apply-templates select="/*" mode="html-title.render" />
</xsl:variable>
<!--
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
End of included transformation: wsdl-viewer-global.xsl
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-->
<!--
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Begin of included transformation: wsdl-viewer-css.xsl
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-->
<xsl:variable name="css">
/** wsdl-viewer.css */
/** ========================================= Body
========================================= */ html {
background-color: teal; }
body { margin: 0; padding: 0; height: auto; color: white;
background-color: teal; font: normal 80%/120% Arial, Helvetica,
sans-serif; }
#outer_box { padding: 3px 3px 3px 194px; }
#inner_box { width: auto; background-color: white; color: black;
border: 1px solid navy; }
/** ========================================= Fixed box with
links ========================================= */ #outer_links
{ position: fixed; left: 0px; top: 0px; margin: 3px; padding:
1px; z-index: 200; width: 180px; height: auto; background-color:
gainsboro; padding-top: 2px; border: 1px solid navy; }
* html #outer_links /* Override above rule for IE */ { position:
absolute; width: 188px; top: expression(offsetParent.scrollTop +
0); }
#links { margin: 1px; padding: 3px; background-color: white;
height: 350px; overflow: auto; border: 1px solid navy; }
#links ul { left: -999em; list-style: none; margin: 0; padding:
0; z-index: 100; }
#links li { margin: 0; padding: 2px 4px; width: auto; z-index:
100; }
#links ul li { margin: 0; padding: 2px 4px; width: auto;
z-index: 100; }
#links a { display: block; padding: 0 2px; color: blue; width:
auto; border: 1px solid white; text-decoration: none;
white-space: nowrap; }
#links a:hover { color: white; background-color: gray; border:
1px solid gray; }
/** ========================================= Navigation tabs
========================================= */
#outer_nav { background-color: yellow; padding: 0; margin: 0; }
#nav { height: 100%; width: auto; margin: 0; padding: 0;
background-color: gainsboro; border-top: 1px solid gray;
border-bottom: 3px solid gray; z-index: 100; font: bold 90%/120%
Arial, Helvetica, sans-serif; letter-spacing: 2px; }
#nav ul { background-color: gainsboro; height: auto; width:
auto; list-style: none; margin: 0; padding: 0; z-index: 100;
border: 1px solid silver; border-top-color: black; border-width:
1px 0 9px; }
#nav li { display: inline; padding: 0; margin: 0; }
#nav a { position: relative; top: 3px; float:left; width:auto;
padding: 8px 10px 6px 10px; margin: 3px 3px 0; border: 1px solid
gray; border-width: 2px 2px 3px 2px;
color: black; background-color: silver; text-decoration:none;
text-transform: uppercase; }
#nav a:hover { margin-top: 1px; padding-top: 9px;
padding-bottom: 7px; color: blue; background-color: gainsboro; }
#nav a.current:link, #nav a.current:visited, #nav
a.current:hover { background: white; color: black;
text-shadow:none; margin-top: 0; padding-top: 11px;
padding-bottom: 9px; border-bottom-width: 0; border-color: red;
}
#nav a:active { background-color: silver; color: white; }
/** ========================================= Content
========================================= */ #header { margin:
0; padding: .5em 4em; color: white; background-color: red;
border: 1px solid darkred; }
#content { margin: 0; padding: 0 2em .5em; }
#footer { clear: both; margin: 0; padding: .5em 2em; color:
gray; background-color: gainsboro; font-size: 80%; border-top:
1px dotted gray; text-align: right }
.single_column { padding: 10px 10px 10px 10px; /*margin: 0px 33%
0px 0px; */ margin: 3px 0; }
#flexi_column { padding: 10px 10px 10px 10px; /*margin: 0px 33%
0px 0px; */ margin: 0px 212px 0px 0px; }
#fix_column { float: right; padding: 10px 10px 10px 10px;
margin: 0px; width: 205px; /*width: 30%; */ voice-family:
"\"}\""; voice-family:inherit; /* width: 30%; */ width: 205px; }
html>body #rightColumn { width: 205px; /* ie5win fudge ends
*/ } /* Opera5.02 shows a 2px gap between. N6.01Win sometimes
does. Depends on amount of fill and window size and wind
direction. */
/** ========================================= Label / value
========================================= */
.page { border-bottom: 3px dotted navy; margin: 0; padding: 10px
0 20px 0; }
.value, .label { margin: 0; padding: 0; }
.label { float: left; width: 140px; text-align: right;
font-weight: bold; padding-bottom: .5em; margin-right: 0; color:
darkblue; }
.value { margin-left: 147px; color: darkblue; padding-bottom:
.5em; }
strong, strong a { color: darkblue; font-weight: bold;
letter-spacing: 1px; margin-left: 2px; }
/** ========================================= Links
========================================= */
a.local:link, a.local:visited { color: blue; margin-left: 10px;
border-bottom: 1px dotted blue; text-decoration: none;
font-style: italic; }
a.local:hover { background-color: gainsboro; color: darkblue;
padding-bottom: 1px; border-bottom: 1px solid darkblue; }
a.target:link, a.target:visited, a.target:hover {
text-decoration: none; background-color: transparent;
border-bottom-type: none; }
/** ========================================= Box, Shadow
========================================= */
.box { padding: 6px; color: black; background-color: gainsboro;
border: 1px solid gray; }
.shadow { background: silver; position: relative; top: 5px;
left: 4px; }
.shadow div { position: relative; top: -5px; left: -4px; }
/** ========================================= Floatcontainer
========================================= */
.spacer { display: block; height: 0; font-size: 0; line-height:
0; margin: 0; padding: 0; border-style: none; clear: both;
visibility:hidden; }
.floatcontainer:after { content: "."; display: block; height: 0;
font-size:0; clear: both; visibility:hidden; } .floatcontainer{
display: inline-table; } /* Mark Hadley's fix for IE Mac */ /*
Hides from IE Mac \*/ * html .floatcontainer { height: 1%; }
.floatcontainer{ display:block; } /* End Hack */
/** ========================================= Source code
========================================= */
.indent { margin: 2px 0 2px 20px; }
.xml-element, .xml-proc, .xml-comment { margin: 2px 0; padding:
2px 0 2px 0; }
.xml-element { word-spacing: 3px; color: red; font-weight: bold;
font-style:normal; border-left: 1px dotted silver; }
.xml-element div { margin: 2px 0 2px 40px; }
.xml-att { color: blue; font-weight: bold; }
.xml-att-val { color: blue; font-weight: normal; }
.xml-proc { color: darkred; font-weight: normal; font-style:
italic; }
.xml-comment { color: green; font-weight: normal; font-style:
italic; }
.xml-text { color: green; font-weight: normal; font-style:
normal; }
/** ========================================= Heading
========================================= */ h1, h2, h3 {
margin: 10px 10px 2px; font-family: Georgia, Times New Roman,
Times, Serif; font-weight: normal; }
h1 { font-weight: bold; letter-spacing: 3px; font-size: 220%;
line-height: 100%; }
h2 { font-weight: bold; font-size: 175%; line-height: 200%; }
h3 { font-size: 150%; line-height: 150%; font-style: italic; }
/** ========================================= Content formatting
========================================= */ .port {
margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px
dashed gray; }
.operation { margin-bottom: 20px; padding-bottom: 10px;
border-bottom: 1px dashed gray; }
/* --------------------------------------------------------
Printing */
/* @media print { #outer_links, #outer_nav { display: none; } */
#outer_box { padding: 3px; } /* END print media definition } */
</xsl:variable>
<!--
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
End of included transformation: wsdl-viewer-css.xsl
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-->
<!--
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Begin of included transformation: wsdl-viewer-util.xsl
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-->
<xsl:template match="@*" mode="qname.normalized">
<xsl:variable name="local" select="substring-after(., ':')" />
<xsl:choose>
<xsl:when test="$local">
<xsl:value-of select="$local" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="." />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="ws:definitions | ws2:description"
mode="html-title.render">
<xsl:choose>
<xsl:when test="$global.service-name">
<xsl:value-of
select="concat('Web Service: ', $global.service-name)" />
</xsl:when>
<xsl:when test="$global.binding-name">
<xsl:value-of
select="concat('WS Binding: ', $global.binding-name)" />
</xsl:when>
<xsl:when test="$consolidated-wsdl/ws2:interface/@name">
<xsl:value-of
select="concat('WS Interface: ', $consolidated-wsdl/ws2:interface/@name)" />
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
Syntax error in element
<xsl:call-template name="src.syntax-error.path" />
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="src.syntax-error">
<xsl:message terminate="yes">
Syntax error by WSDL source rendering in element
<xsl:call-template name="src.syntax-error.path" />
</xsl:message>
</xsl:template>
<xsl:template name="src.syntax-error.path">
<xsl:for-each select="parent::*">
<xsl:call-template name="src.syntax-error.path" />
</xsl:for-each>
<xsl:value-of
select="concat('/', name(), '[', position(), ']')" />
</xsl:template>
<xsl:template match="*[local-name(.) = 'documentation']"
mode="documentation.render">
<xsl:if
test="$ENABLE-DESCRIPTION and string-length(.) > 0">
<div class="label">Description:</div>
<div class="value">
<xsl:value-of select="." disable-output-escaping="yes" />
</div>
</xsl:if>
</xsl:template>
<xsl:template name="render.source-code-link">
<xsl:if test="$ENABLE-SRC-CODE-PARAGRAPH and $ENABLE-LINK">
<a class="local"
href="{concat('#', $SRC-PREFIX, generate-id(.))}">
<xsl:value-of select="$SOURCE-CODE-TEXT" />
</a>
</xsl:if>
</xsl:template>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -