recordx-xslt 0.1.6 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data/lib/recordx-xslt.rb +37 -14
- data.tar.gz.sig +4 -3
- metadata +50 -26
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 531d10bd42deb16c83caf1d4f3beb6da9e1ec6cb9f88281ce7b93737c1dfc0b0
|
4
|
+
data.tar.gz: a4d34afe21106986a29a2de16c6d3d25df816da6b8cec0154b85394711e0095e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6a3eb1435df8e8d89624d79ea8ec08e04df0aca249056e84f5555e449a7a47f290267a9b9144113fcf9b5e8489822121d7da7d84188a7e7a05f767069e66208
|
7
|
+
data.tar.gz: 1f273f78518584972476dddbebc3b97e72d00d4a7f1cc5173e0416995b52887d57b9d60b226aebd4385b100d8269b3aff801f825955d7a8db8c176b6fffb5772
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/recordx-xslt.rb
CHANGED
@@ -2,13 +2,18 @@
|
|
2
2
|
|
3
3
|
# file: recordx-xslt.rb
|
4
4
|
|
5
|
+
require 'c32'
|
6
|
+
|
7
|
+
|
5
8
|
class RecordxXSLT
|
9
|
+
using ColouredText
|
6
10
|
|
7
11
|
attr_accessor :schema, :xslt_schema
|
8
12
|
|
9
|
-
def initialize(
|
10
|
-
|
11
|
-
@schema, @xslt_schema =
|
13
|
+
def initialize(schema: '', xslt_schema: '', debug: false)
|
14
|
+
|
15
|
+
@schema, @xslt_schema, @debug = schema, xslt_schema, debug
|
16
|
+
|
12
17
|
end
|
13
18
|
|
14
19
|
def to_xslt()
|
@@ -23,6 +28,7 @@ HEADER
|
|
23
28
|
a_element = @schema.split('/').map{|x| x[/\w+/]}
|
24
29
|
|
25
30
|
@xslt_schema = build_xslt_schema(@schema) if @xslt_schema.empty?
|
31
|
+
puts ('@xslt_schema: ' + @xslt_schema.inspect).debug if @debug
|
26
32
|
|
27
33
|
a_html = @xslt_schema.split('/').map do |x|
|
28
34
|
|
@@ -34,6 +40,8 @@ HEADER
|
|
34
40
|
|
35
41
|
[name, list]
|
36
42
|
end
|
43
|
+
|
44
|
+
puts ('a_html: ' + a_html.inspect).debug if @debug
|
37
45
|
|
38
46
|
a = a_element.zip(a_html).map.with_index do |a,i|
|
39
47
|
|
@@ -87,6 +95,7 @@ HEADER
|
|
87
95
|
|
88
96
|
out << indent + "<%s>\n" % tag
|
89
97
|
out << indent + " <xsl:apply-templates select='summary'/>\n"
|
98
|
+
out << indent + " <xsl:apply-templates select='records'/>\n"
|
90
99
|
out << indent + "</%s>\n" % tag
|
91
100
|
out << "</xsl:template>\n\n"
|
92
101
|
out << "<xsl:template match='%s/summary'>\n" % [prev_tag]
|
@@ -101,21 +110,35 @@ HEADER
|
|
101
110
|
|
102
111
|
else
|
103
112
|
a.map do |target,src|
|
113
|
+
|
114
|
+
if @debug then
|
115
|
+
puts 'target: ' + target.inspect
|
116
|
+
puts 'src: ' + src.inspect
|
117
|
+
end
|
104
118
|
|
105
119
|
if src then
|
106
120
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
121
|
+
if target[0] == '@' then
|
122
|
+
|
123
|
+
target.slice!(0,1)
|
124
|
+
out << indent + "<xsl:attribute name='#{target}'>" +
|
125
|
+
"<xsl:value-of select='#{src}'/></xsl:attribute>\n"
|
126
|
+
else
|
127
|
+
|
128
|
+
start_tag = target.gsub(/\s*\{[^\}]+\}/) do |attr|
|
129
|
+
|
130
|
+
' ' + attr.scan(/(\w+[:=]\s*(?:\w+|["'][^"']+["'])),?\s*/)\
|
131
|
+
.map {|x| x.first.split(/\s*[:=]\s*/) }\
|
132
|
+
.map {|attr, val| "%s='%s'" % [attr,val.gsub(/^["']|["']$/,'')]}\
|
133
|
+
.join(', ')
|
134
|
+
end
|
135
|
+
|
136
|
+
end_tag = target.gsub(/\s*{.*/,'')
|
137
|
+
|
138
|
+
out << indent + "<%s><xsl:value-of select='%s'/></%s>\n" %
|
139
|
+
[start_tag,src,end_tag]
|
113
140
|
end
|
114
141
|
|
115
|
-
end_tag = target.gsub(/\s*{.*/,'')
|
116
|
-
|
117
|
-
out << indent + "<%s><xsl:value-of select='%s'/></%s>\n" %
|
118
|
-
[start_tag,src,end_tag]
|
119
142
|
else
|
120
143
|
out << indent + "<%s></%s>\n" % ([target] * 2)
|
121
144
|
end
|
@@ -125,4 +148,4 @@ HEADER
|
|
125
148
|
out
|
126
149
|
end
|
127
150
|
|
128
|
-
end
|
151
|
+
end
|
data.tar.gz.sig
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
�
|
1
|
+
���x�c[� =���o����rz,�ݦY�C`[�W�����h��:��IYOa�k*�Ტ̆�|��"��1�4�/Inۇ�y��C�z��p��AE[(�T'X
|
2
|
+
�Yoaco>�h�3��<�7S��Es�h�KX�k��r������vi��jwg����=Y�#��n/���
|
3
|
+
�g����ePz}��ۓ���f����+���������jZ���?Pj����ꛍ�Ρx~]�o�+L�
|
4
|
+
ǧg|w�H�bG�RNw��A�ip�F\6�biʳ
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recordx-xslt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,29 +10,53 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21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wJgYDVR0RBB8wHYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0
|
27
|
+
c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1hc3RlckBqYW1lc3JvYmVydHNvbi5ldTAN
|
28
|
+
BgkqhkiG9w0BAQsFAAOCAYEARR1vvPW/CdQ6qXvLk46T+AFpbCDA4QwPiBakxA22
|
29
|
+
7nwIcOrvDVNM6XrU6PT74HvQbAhTISalTSVs+elZmd1T4ZIDHTUgTOnWJkvsrbfj
|
30
|
+
R7HNxC/N8Glw3Fi9jd78KZZUmXQGa1zP9RVBgvcapCC1ErOGmsqaPE22xgpyFpTF
|
31
|
+
tlSGNn9hCXjuP4yTCp1TQFThMyHlpGERBwANqYKon4IVGSBIp4wzO2ZfrztE004W
|
32
|
+
mZYtrdBOryQC7J4CsVz5na3yoqD/oGtIv5Lc5XtFEZsE044SFz9bLnNu/DRZpvrm
|
33
|
+
jxHmhBmdy/nmdRBbqy/cLUWUkM6d5qaXFzDhyA3RptS/xJCGerU7pWNSJje/YwDp
|
34
|
+
VKfTPTiy+M1DHyo6ywCg1NnLQKR+dVTklWn0OoDQoKdHnXiWZxgTll2TWeh4/+j9
|
35
|
+
QD/5hdIe2Jm8+F1UmAR0o297oLqfSF7FANUbtFo/ogklVSFkMOeAdOaa4IklWdeF
|
36
|
+
924Z2hq1Gp9hvWrwijmYoIUZ
|
33
37
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
35
|
-
dependencies:
|
38
|
+
date: 2019-07-30 00:00:00.000000000 Z
|
39
|
+
dependencies:
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: c32
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.2.0
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0.2'
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 0.2.0
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0.2'
|
36
60
|
description:
|
37
61
|
email: james@jamesrobertson.eu
|
38
62
|
executables: []
|
@@ -59,9 +83,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
83
|
- !ruby/object:Gem::Version
|
60
84
|
version: '0'
|
61
85
|
requirements: []
|
62
|
-
|
63
|
-
rubygems_version: 2.6.8
|
86
|
+
rubygems_version: 3.0.1
|
64
87
|
signing_key:
|
65
88
|
specification_version: 4
|
66
|
-
summary:
|
89
|
+
summary: Transforms a RecordX type of schema with an XSLT schema mapping to generate
|
90
|
+
an XSLT document.
|
67
91
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|