Skip to content
This repository was archived by the owner on Feb 9, 2019. It is now read-only.

Commit e4b6dbb

Browse files
authored
Merge pull request #1 from jmarsik/pr-cdn-normalize-exmp
References switched to CDNJS, fixed JS error in DOM / text manipulation, new example
2 parents 54e7c01 + be80ab6 commit e4b6dbb

File tree

2 files changed

+73
-50
lines changed

2 files changed

+73
-50
lines changed

examples/test_xsltproc.bat

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
rem You can make xsltproc.exe available on Windows by using Chocolatey package manager.
2+
rem If you are using Chocolatey, just run "choco install strawberryperl" and after that the batch file should work.
3+
4+
set RESULTS_DIR=msxsl-results
5+
set LINKS_FILE=links.xml
6+
7+
set XSLT_FILE=xs3p.xsl
8+
set ORIGINAL_XSLT_FILE=..\%XSLT_FILE%
9+
rem Copy XSLT file to local directory
10+
copy %ORIGINAL_XSLT_FILE% .
11+
rem Create results directory
12+
if not exist %RESULTS_DIR% mkdir %RESULTS_DIR%
13+
rem Loop through schema files
14+
for %%f in (*.xsd) do xsltproc.exe --nonet --output %RESULTS_DIR%\%%f.html %XSLT_FILE% %%f
15+
16+
rem Test external links
17+
rem set XSD_FILE=address.xsd
18+
rem xsltproc.exe --nonet --stringparam searchImportedSchemas true --stringparam searchIncludedSchemas true --stringparam linksFile %LINKS_FILE% --output %RESULTS_DIR%\%XSD_FILE%.html %XSLT_FILE% %XSD_FILE%
19+
20+
rem Delete local copy of stylesheet
21+
del %XSLT_FILE%

xs3p.xsl

Lines changed: 52 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,12 @@
159159
<xsl:param name="externalCSSURL"></xsl:param>
160160

161161
<!-- Link to JQuery. -->
162-
<xsl:param name="jQueryURL">https://code.jquery.com/jquery-2.2.1.min.js</xsl:param>
162+
<xsl:param name="jQueryURL">https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.min.js</xsl:param>
163163

164164
<!-- Link base to Bootstrap CSS and JS. The files
165165
<bootstrapURL>/css/bootstrap.min.css and
166166
<bootstrapURL>/js/bootstrap.min.js must exist.-->
167-
<xsl:param name="bootstrapURL">https://netdna.bootstrapcdn.com/bootstrap/3.3.6</xsl:param>
167+
<xsl:param name="bootstrapURL">https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6</xsl:param>
168168

169169
<!-- ******** Constants ******** -->
170170

@@ -302,7 +302,7 @@
302302
</xsl:choose>
303303
</style>
304304

305-
<script src="https://pagedown.googlecode.com/hg/Markdown.Converter.js">
305+
<script src="https://cdnjs.cloudflare.com/ajax/libs/pagedown/1.0/Markdown.Converter.js">
306306
// Import Markdown converter for comments processing
307307
</script>
308308

@@ -433,6 +433,8 @@
433433
var indent = $(rawDocID).html().match("^\\n[\\t ]*");
434434
if (!(indent === null)) {
435435
normalized = $(rawDocID).html().replace(new RegExp(indent[0], "gm"), "\n");
436+
} else {
437+
normalized = $(rawDocID).html();
436438
}
437439
$(this).html(c.makeHtml(normalized));
438440
$(this).find('code,pre').each(function(i, block) {
@@ -710,105 +712,105 @@
710712
<xsl:text disable-output-escaping="yes">
711713
/* XS3P specific CSS */
712714
body {
713-
background-color: #FFF;
714-
padding-top: 50px;
715+
background-color: #FFF;
716+
padding-top: 50px;
715717
}
716718

717719
.nav &gt; li.active {
718-
background-color: #FFF;
720+
background-color: #FFF;
719721
}
720722
.nav &gt; li &gt; a:hover {
721-
background-color: #CCC;
723+
background-color: #CCC;
722724
}
723725

724726
code {
725-
color: #333;
727+
color: #333;
726728
}
727729

728730
.container-fluid {
729-
padding: 15px 15px;
731+
padding: 15px 15px;
730732
}
731733

732734
.nav-sub-item &gt; a {
733-
padding-left: 30px !important;
735+
padding-left: 30px !important;
734736
}
735737

736738
a.name {
737-
padding-top: 65px;
739+
padding-top: 65px;
738740
}
739741

740742
h3.xs3p-subsection-heading {
741-
margin-bottom: 30px;
743+
margin-bottom: 30px;
742744
}
743745

744746
section, #top {
745-
margin-top: -65px;
746-
padding-top: 65px;
747+
margin-top: -65px;
748+
padding-top: 65px;
747749
}
748750

749751
pre {
750-
padding: 5px;
752+
padding: 5px;
751753
}
752754

753755
.xs3p-sidenav {
754-
padding-top: 10px;
755-
padding-bottom: 10px;
756-
background-color: #EEE;
757-
border-radius: 10px;
756+
padding-top: 10px;
757+
padding-bottom: 10px;
758+
background-color: #EEE;
759+
border-radius: 10px;
758760
}
759761
.xs3p-navbar-title {
760-
color: #FFF !important;
761-
font-weight: bold;
762+
color: #FFF !important;
763+
font-weight: bold;
762764
}
763765
.xs3p-in-panel-table {
764-
margin-bottom: 0px;
766+
margin-bottom: 0px;
765767
}
766768
.xs3p-sidebar {
767-
position: static;
769+
position: static;
768770
}
769771
.xs3p-collapse-button {
770-
font-size: 8pt;
772+
font-size: 8pt;
771773
}
772774
.panel-heading .xs3p-panel-title:after {
773-
font-family: 'Glyphicons Halflings';
774-
content: "\e114";
775-
float: left;
776-
color: grey;
777-
margin-right: 10px;
775+
font-family: 'Glyphicons Halflings';
776+
content: "\e114";
777+
float: left;
778+
color: grey;
779+
margin-right: 10px;
778780
}
779781
.panel-heading .xs3p-panel-title.collapsed:after {
780-
content: "\e080";
782+
content: "\e080";
781783
}
782784
.panel-info > .panel-heading .xs3p-panel-title:after {
783-
color: white;
785+
color: white;
784786
}
785787
.xs3p-panel-help {
786-
color: #CCCCCC;
787-
cursor: pointer;
788+
color: #CCCCCC;
789+
cursor: pointer;
788790
}
789791

790792
.panel-group {
791-
margin-bottom: 20px;
793+
margin-bottom: 20px;
792794
}
793795

794796
.btn-doc {
795-
padding: 0px;
796-
border: 0px none;
797-
background: none repeat scroll 0% 0% transparent;
798-
line-height: 1;
799-
font-size: 12px;
797+
padding: 0px;
798+
border: 0px none;
799+
background: none repeat scroll 0% 0% transparent;
800+
line-height: 1;
801+
font-size: 12px;
800802
}
801803

802804
.unpre {
803-
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
804-
font-size: 14px;
805-
white-space: normal;
806-
word-break: normal;
807-
word-wrap: normal;
805+
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
806+
font-size: 14px;
807+
white-space: normal;
808+
word-break: normal;
809+
word-wrap: normal;
808810
}
809811

810812
.popover {
811-
max-width: 400px;
813+
max-width: 400px;
812814
}
813815

814816
// Syntax highlighting
@@ -823,11 +825,11 @@ pre {
823825
.codehilite a:hover {opacity: 0.7 !important;}
824826

825827
@media (min-width: 992px) {
826-
.xs3p-sidebar {
827-
position: fixed;
828-
top: 65px;
829-
width: 22%;
830-
}
828+
.xs3p-sidebar {
829+
position: fixed;
830+
top: 65px;
831+
width: 22%;
832+
}
831833
}
832834
</xsl:text>
833835
</xsl:template>

0 commit comments

Comments
 (0)