Moved CSS for API XSLT to api.xsl, and fixed element names
这个提交包含在:
父节点
c20dfafef1
当前提交
fca42eec3e
共有 3 个文件被更改,包括 57 次插入 和 56 次删除
|
|
@ -5,7 +5,7 @@ $xmlDoc = new DOMDocument("1.0");
|
||||||
|
|
||||||
if($data['format'] == "xml") {
|
if($data['format'] == "xml") {
|
||||||
// Add reference to the XSLT
|
// Add reference to the XSLT
|
||||||
$xsl = $xmlDoc->createProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"/css/api.xsl\"");
|
$xsl = $xmlDoc->createProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"".base_url()."css/api.xsl\"");
|
||||||
$xmlDoc->appendChild($xsl);
|
$xmlDoc->appendChild($xsl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
52
css/api.css
52
css/api.css
|
|
@ -1,52 +0,0 @@
|
||||||
body {
|
|
||||||
background: #eee;
|
|
||||||
font-family: Verdana, sans-serif;
|
|
||||||
font-size: 8px;
|
|
||||||
}
|
|
||||||
#results table {
|
|
||||||
border: 0px solid #000;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
#results th {
|
|
||||||
padding: 4px;
|
|
||||||
border: 1px solid #000;
|
|
||||||
background-color: #6AA57B;
|
|
||||||
font-size: 11px;
|
|
||||||
}
|
|
||||||
#results td {
|
|
||||||
padding: 4px;
|
|
||||||
border: 1px solid #000;
|
|
||||||
font-size: 11px;
|
|
||||||
}
|
|
||||||
#results tr.row0 {
|
|
||||||
background-color: #A3BDF5;
|
|
||||||
}
|
|
||||||
#results tr.row1 {
|
|
||||||
background-color: #9ADF9A;
|
|
||||||
}
|
|
||||||
img {
|
|
||||||
border: 0px;
|
|
||||||
}
|
|
||||||
#footer {
|
|
||||||
font-size: 8px;
|
|
||||||
}
|
|
||||||
#debug {
|
|
||||||
border: 1px dotted #fff;
|
|
||||||
background-color: #c00;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 8px;
|
|
||||||
}
|
|
||||||
#debug td {
|
|
||||||
padding: 4px;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 10px;
|
|
||||||
}
|
|
||||||
.blank {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
.sub {
|
|
||||||
background-color: #cfc;
|
|
||||||
}
|
|
||||||
.subattr {
|
|
||||||
background-color: #cfc;
|
|
||||||
}
|
|
||||||
59
css/api.xsl
59
css/api.xsl
|
|
@ -5,17 +5,70 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title><xsl:value-of select="//queryInfo/@calledMethod"/></title>
|
<title><xsl:value-of select="//queryInfo/@calledMethod"/></title>
|
||||||
<link rel="stylesheet" href="/css/api.css" type="text/css" />
|
<style>
|
||||||
|
body {
|
||||||
|
background: #eee;
|
||||||
|
font-family: Verdana, sans-serif;
|
||||||
|
font-size: 8px;
|
||||||
|
}
|
||||||
|
#results table {
|
||||||
|
border: 0px solid #000;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
#results th {
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid #000;
|
||||||
|
background-color: #6AA57B;
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
#results td {
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid #000;
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
#results tr.row0 {
|
||||||
|
background-color: #A3BDF5;
|
||||||
|
}
|
||||||
|
#results tr.row1 {
|
||||||
|
background-color: #9ADF9A;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
border: 0px;
|
||||||
|
}
|
||||||
|
#footer {
|
||||||
|
font-size: 8px;
|
||||||
|
}
|
||||||
|
#debug {
|
||||||
|
border: 1px dotted #fff;
|
||||||
|
background-color: #c00;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 8px;
|
||||||
|
}
|
||||||
|
#debug td {
|
||||||
|
padding: 4px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
.blank {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
.sub {
|
||||||
|
background-color: #cfc;
|
||||||
|
}
|
||||||
|
.subattr {
|
||||||
|
background-color: #cfc;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Output of '<xsl:value-of select="//queryInfo/@calledMethod"/>'</h1>
|
<h1>Output of '<xsl:value-of select="//queryInfo/@calledMethod"/>'</h1>
|
||||||
<table id="results">
|
<table id="results">
|
||||||
<tr>
|
<tr>
|
||||||
<xsl:for-each select="//elements/element[1]/@*">
|
<xsl:for-each select="//results/result[1]/@*">
|
||||||
<th><b><xsl:value-of select="name()"/></b></th>
|
<th><b><xsl:value-of select="name()"/></b></th>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</tr>
|
</tr>
|
||||||
<xsl:for-each select="//elements/element">
|
<xsl:for-each select="//results/result">
|
||||||
<tr class="row{position() mod 2}">
|
<tr class="row{position() mod 2}">
|
||||||
<xsl:for-each select="@*">
|
<xsl:for-each select="@*">
|
||||||
<td><xsl:value-of select="."/></td>
|
<td><xsl:value-of select="."/></td>
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用