rack-xsl 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ gemfile: vendor/Gemfile
data/README.md CHANGED
@@ -5,6 +5,7 @@ Summary
5
5
 
6
6
  A rack middleware for transforming XML with XSL.
7
7
 
8
+
8
9
  Configuration
9
10
  -------------
10
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.8
1
+ 0.2.9
@@ -22,7 +22,7 @@ limitations under the License.
22
22
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
23
23
  xmlns="http://www.w3.org/1999/xhtml">
24
24
 
25
- <xsl:import href="http://github.com/docunext/1bb02b59/raw/master/standard.html.xsl"/>
25
+ <xsl:import href="./lib/rack/standard.html.xsl"/>
26
26
 
27
27
 
28
28
  <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no"
@@ -0,0 +1,150 @@
1
+ <!--
2
+ Program: 1bb02b59
3
+ Component: standard.html.xsl
4
+ Copyright: Savonix Corporation
5
+ Author: Albert L. Lash, IV
6
+ License: Apache License, Version 2.0
7
+
8
+ Copyright 2009 Savonix Corporation
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+ -->
22
+ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
23
+ xmlns="http://www.w3.org/1999/xhtml">
24
+
25
+ <xsl:param name="analytics_key"></xsl:param>
26
+ <xsl:param name="analytics_path">/</xsl:param>
27
+
28
+ <!-- UI PRIMARY MENU -->
29
+ <xsl:template name="nav-menu">
30
+ <ul id="nav">
31
+ <xsl:for-each select="//menu/item[not(@active=0)]">
32
+ <xsl:call-template name="list-button">
33
+ <xsl:with-param name="key" select="key"/>
34
+ </xsl:call-template>
35
+ </xsl:for-each>
36
+ </ul>
37
+ </xsl:template>
38
+
39
+ <!-- UI LIST BUTTON -->
40
+ <xsl:template name="list-button">
41
+ <xsl:param name="key"/>
42
+ <li>
43
+ <a href="#" class="head">
44
+ <xsl:value-of select="/_R_/i18n/*[name()=$key]"/>
45
+ </a>
46
+ <ul>
47
+ <xsl:for-each select="//menu/item[key=$key]/item">
48
+ <xsl:variable name="my_key" select="key"/>
49
+ <li>
50
+ <a href="{//runtime/link_prefix}{url}" id="{key}">
51
+ <xsl:value-of select="/_R_/i18n/*[name()=$my_key]"/>
52
+ </a>
53
+ </li>
54
+ </xsl:for-each>
55
+ </ul>
56
+ </li>
57
+ </xsl:template>
58
+
59
+ <!-- UI HEADER -->
60
+ <xsl:template name="header">
61
+ <xsl:param name="i18n"/>
62
+ <div id="header">&#160;
63
+ <span id="company-name">
64
+ <xsl:value-of select="//runtime/company_name"/>
65
+ </span>
66
+ <h1 class="page-title">
67
+ <xsl:value-of select="/_R_/i18n/*[name()=/_R_/_get/nid]"/>
68
+ </h1>
69
+ </div>
70
+ </xsl:template>
71
+
72
+ <!-- HTML SHELL -->
73
+ <xsl:template name="page">
74
+ <html>
75
+
76
+ <xsl:call-template name="head" />
77
+ <body>
78
+ <xsl:for-each select="//pre_body_content">
79
+ <xsl:sort select="priority" order="ascending"/>
80
+ <xsl:apply-templates select="nodes/*"/>
81
+ </xsl:for-each>
82
+
83
+ <xsl:apply-templates />
84
+
85
+ <xsl:for-each select="//footer_nodes">
86
+ <xsl:sort select="priority" order="ascending"/>
87
+ <xsl:apply-templates select="nodes/*"/>
88
+ </xsl:for-each>
89
+ </body>
90
+ </html>
91
+ </xsl:template>
92
+
93
+
94
+ <!-- HTML HEAD -->
95
+ <xsl:template name="head">
96
+ <head>
97
+ <title>
98
+ <xsl:value-of select="(//h1|//h2)[1]" />
99
+ </title>
100
+ </head>
101
+ </xsl:template>
102
+
103
+
104
+ <!-- DEPRECATED TEMPLATES -->
105
+ <xsl:template name="main-menu">
106
+ <xsl:comment>As of 2009-12, main-menu is deprecated. Use nav-menu.</xsl:comment>
107
+ </xsl:template>
108
+ <xsl:template name="main" />
109
+ <xsl:template name="drop-downs" />
110
+
111
+ <xsl:template name="g_analytics_code">
112
+ <xsl:if test="not($analytics_key='')">
113
+ <script type="text/javascript">
114
+
115
+ var _gaq = _gaq || [];
116
+ _gaq.push(['_setAccount', '<xsl:value-of select="$analytics_key"/>']);
117
+ _gaq.push(['_trackPageview']);
118
+
119
+ (function() {
120
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
121
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
122
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
123
+ })();
124
+
125
+ </script>
126
+ </xsl:if>
127
+ </xsl:template>
128
+
129
+
130
+
131
+ <!-- XHTML FRIENDLY IDENTITY TEMPLATE FOR ELEMENTS-->
132
+ <xsl:template match="node()">
133
+ <xsl:element name="{name()}">
134
+ <xsl:apply-templates select="@*|node()"/>
135
+ </xsl:element>
136
+ </xsl:template>
137
+
138
+ <!-- XHTML FRIENDLY IDENTITY TEMPLATE FOR CONTENT AND ATTRIBUTES -->
139
+ <xsl:template match="@*|text()">
140
+ <xsl:copy/>
141
+ </xsl:template>
142
+
143
+ <xsl:template match="comment()">
144
+ <xsl:copy/>
145
+ </xsl:template>
146
+
147
+ <xsl:template match="@xml:space" />
148
+
149
+
150
+ </xsl:stylesheet>
@@ -13,7 +13,8 @@ module Rack
13
13
  if @options[:myxsl].nil?
14
14
  require 'rexml/document'
15
15
  @xslt = XML::XSLT.new()
16
- @xslt.xsl = REXML::Document.new '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml"><xsl:import href="http://github.com/docunext/1bb02b59/raw/master/standard.html.xsl"/><xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" indent="yes"/></xsl:stylesheet>'
16
+ myfile = File.new('./lib/rack/output.xhtml10.xsl')
17
+ @xslt.xsl = REXML::Document.new myfile
17
18
  else
18
19
  @xslt = @options[:myxsl]
19
20
  @xslt.xsl = REXML::Document.new @options[:xslfile]
@@ -0,0 +1,9 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rake'
4
+ gem 'ruby-xslt', :require => 'xml/xslt'
5
+
6
+ group :test do
7
+ gem 'shoulda'
8
+ gem 'mocha'
9
+ end
metadata CHANGED
@@ -1,68 +1,92 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rack-xsl
3
- version: !ruby/object:Gem::Version
4
- version: 0.2.8
3
+ version: !ruby/object:Gem::Version
4
+ hash: 5
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 9
10
+ version: 0.2.9
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Albert Lash
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-07-10 00:00:00.000000000 -04:00
17
+
18
+ date: 2011-08-14 00:00:00 -04:00
13
19
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
16
22
  name: shoulda
17
- requirement: &81052570 !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
18
25
  none: false
19
- requirements:
20
- - - ! '>='
21
- - !ruby/object:Gem::Version
22
- version: '0'
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
23
33
  type: :development
24
- prerelease: false
25
- version_requirements: *81052570
34
+ version_requirements: *id001
26
35
  description: Rack middleware for transforming XML with XSL.
27
36
  email: albert.lash@docunext.com
28
37
  executables: []
38
+
29
39
  extensions: []
30
- extra_rdoc_files:
40
+
41
+ extra_rdoc_files:
31
42
  - LICENSE
32
43
  - README.md
33
- files:
44
+ files:
45
+ - .travis.yml
34
46
  - LICENSE
35
47
  - README.md
36
48
  - Rakefile
37
49
  - VERSION
38
- - lib/output.xhtml10.xsl
50
+ - lib/rack/output.xhtml10.xsl
51
+ - lib/rack/standard.html.xsl
39
52
  - lib/rack/xsl.rb
40
53
  - test/rack-xslview_test.rb
41
54
  - test/test_helper.rb
42
55
  - test/test_install.rb
56
+ - vendor/Gemfile
43
57
  has_rdoc: true
44
58
  homepage: http://www.docunext.com/wiki/Rack-XSLView
45
59
  licenses: []
60
+
46
61
  post_install_message:
47
62
  rdoc_options: []
48
- require_paths:
63
+
64
+ require_paths:
49
65
  - lib
50
- required_ruby_version: !ruby/object:Gem::Requirement
66
+ required_ruby_version: !ruby/object:Gem::Requirement
51
67
  none: false
52
- requirements:
53
- - - ! '>='
54
- - !ruby/object:Gem::Version
55
- version: '0'
56
- required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ hash: 3
72
+ segments:
73
+ - 0
74
+ version: "0"
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
76
  none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ hash: 3
81
+ segments:
82
+ - 0
83
+ version: "0"
62
84
  requirements: []
63
- rubyforge_project: ''
85
+
86
+ rubyforge_project: ""
64
87
  rubygems_version: 1.6.2
65
88
  signing_key:
66
89
  specification_version: 3
67
90
  summary: XSL rack middleware.
68
91
  test_files: []
92
+