libxslt-ruby 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES +161 -154
- data/LICENSE +21 -21
- data/README.rdoc +170 -160
- data/Rakefile +90 -90
- data/ext/libxslt/extconf.h +6 -0
- data/ext/libxslt/extconf.rb +112 -157
- data/ext/libxslt/libxslt.c +68 -69
- data/ext/libxslt/libxslt.h +37 -37
- data/ext/libxslt/ruby_exslt.c +149 -149
- data/ext/libxslt/ruby_exslt.h +8 -8
- data/ext/libxslt/ruby_xslt_stylesheet.c +302 -302
- data/ext/libxslt/ruby_xslt_stylesheet.h +10 -10
- data/ext/libxslt/version.h +5 -5
- data/ext/vc/libxslt_ruby.sln +12 -8
- data/ext/vc/libxslt_ruby.vcxproj +87 -3
- data/lib/libxslt-ruby.rb +14 -0
- data/lib/libxslt.rb +3 -16
- data/lib/libxslt/stylesheet.rb +32 -30
- data/lib/xslt.rb +15 -15
- data/libxslt-ruby.gemspec +45 -43
- data/setup.rb +1585 -1585
- data/test/files/commentary.dtd +34 -34
- data/test/files/fuzface.xml +154 -154
- data/test/files/fuzface.xsl +4 -4
- data/test/files/params.xml +2 -2
- data/test/files/params.xsl +10 -10
- data/test/files/ramblings.xsl +46 -46
- data/test/test_exslt.rb +69 -70
- data/test/test_helper.rb +5 -15
- data/test/test_libxslt.rb +20 -22
- data/test/test_stylesheet.rb +213 -214
- metadata +34 -10
- data/lib/libxslt/deprecated.rb +0 -68
- data/test/test_deprecated.rb +0 -100
- data/test/test_suite.rb +0 -11
@@ -1,10 +1,10 @@
|
|
1
|
-
/* $Id: ruby_xslt_stylesheet.h 42 2007-12-07 06:09:35Z transami $ */
|
2
|
-
|
3
|
-
/* Please see the LICENSE file for copyright and distribution information. */
|
4
|
-
|
5
|
-
#ifndef __RUBY_LIBXSLT_STYLESHEET__
|
6
|
-
#define __RUBY_LIBXSLT_STYLESHEET__
|
7
|
-
|
8
|
-
void ruby_init_xslt_stylesheet(void);
|
9
|
-
|
10
|
-
#endif
|
1
|
+
/* $Id: ruby_xslt_stylesheet.h 42 2007-12-07 06:09:35Z transami $ */
|
2
|
+
|
3
|
+
/* Please see the LICENSE file for copyright and distribution information. */
|
4
|
+
|
5
|
+
#ifndef __RUBY_LIBXSLT_STYLESHEET__
|
6
|
+
#define __RUBY_LIBXSLT_STYLESHEET__
|
7
|
+
|
8
|
+
void ruby_init_xslt_stylesheet(void);
|
9
|
+
|
10
|
+
#endif
|
data/ext/libxslt/version.h
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
#define RUBY_LIBXSLT_VERSION "1.
|
2
|
-
#define RUBY_LIBXSLT_VERNUM 1
|
3
|
-
#define RUBY_LIBXSLT_VER_MAJ
|
4
|
-
#define RUBY_LIBXSLT_VER_MIN
|
5
|
-
#define RUBY_LIBXSLT_VER_MIC 0
|
1
|
+
#define RUBY_LIBXSLT_VERSION "1.2.0"
|
2
|
+
#define RUBY_LIBXSLT_VERNUM 1
|
3
|
+
#define RUBY_LIBXSLT_VER_MAJ 2
|
4
|
+
#define RUBY_LIBXSLT_VER_MIN 0
|
5
|
+
#define RUBY_LIBXSLT_VER_MIC 0
|
data/ext/vc/libxslt_ruby.sln
CHANGED
@@ -1,26 +1,30 @@
|
|
1
1
|
|
2
|
-
Microsoft Visual Studio Solution File, Format Version
|
3
|
-
# Visual Studio
|
2
|
+
Microsoft Visual Studio Solution File, Format Version 12.00
|
3
|
+
# Visual Studio Version 16
|
4
|
+
VisualStudioVersion = 16.0.30011.22
|
5
|
+
MinimumVisualStudioVersion = 10.0.40219.1
|
4
6
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxslt_ruby", "libxslt_ruby.vcxproj", "{6DCFD1E6-224E-479C-BBD9-B6931DFCD02C}"
|
5
7
|
EndProject
|
6
|
-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml_ruby", "..\..\..\libxml-ruby\ext\vc\libxml_ruby_18\libxml_ruby.vcxproj", "{0B65CD1D-EEB9-41AE-93BB-75496E504152}"
|
7
|
-
EndProject
|
8
8
|
Global
|
9
9
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
10
10
|
Debug|Win32 = Debug|Win32
|
11
|
+
Debug|x64 = Debug|x64
|
11
12
|
Release|Win32 = Release|Win32
|
13
|
+
Release|x64 = Release|x64
|
12
14
|
EndGlobalSection
|
13
15
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
14
16
|
{6DCFD1E6-224E-479C-BBD9-B6931DFCD02C}.Debug|Win32.ActiveCfg = Debug|Win32
|
15
17
|
{6DCFD1E6-224E-479C-BBD9-B6931DFCD02C}.Debug|Win32.Build.0 = Debug|Win32
|
18
|
+
{6DCFD1E6-224E-479C-BBD9-B6931DFCD02C}.Debug|x64.ActiveCfg = Debug|x64
|
19
|
+
{6DCFD1E6-224E-479C-BBD9-B6931DFCD02C}.Debug|x64.Build.0 = Debug|x64
|
16
20
|
{6DCFD1E6-224E-479C-BBD9-B6931DFCD02C}.Release|Win32.ActiveCfg = Release|Win32
|
17
21
|
{6DCFD1E6-224E-479C-BBD9-B6931DFCD02C}.Release|Win32.Build.0 = Release|Win32
|
18
|
-
{
|
19
|
-
{0B65CD1D-EEB9-41AE-93BB-75496E504152}.Debug|Win32.Build.0 = Debug|Win32
|
20
|
-
{0B65CD1D-EEB9-41AE-93BB-75496E504152}.Release|Win32.ActiveCfg = Release|Win32
|
21
|
-
{0B65CD1D-EEB9-41AE-93BB-75496E504152}.Release|Win32.Build.0 = Release|Win32
|
22
|
+
{6DCFD1E6-224E-479C-BBD9-B6931DFCD02C}.Release|x64.ActiveCfg = Release|Win32
|
22
23
|
EndGlobalSection
|
23
24
|
GlobalSection(SolutionProperties) = preSolution
|
24
25
|
HideSolutionNode = FALSE
|
25
26
|
EndGlobalSection
|
27
|
+
GlobalSection(ExtensibilityGlobals) = postSolution
|
28
|
+
SolutionGuid = {8DB8102F-FA0E-41BB-A576-68FA3F86A674}
|
29
|
+
EndGlobalSection
|
26
30
|
EndGlobal
|
data/ext/vc/libxslt_ruby.vcxproj
CHANGED
@@ -5,25 +5,47 @@
|
|
5
5
|
<Configuration>Debug</Configuration>
|
6
6
|
<Platform>Win32</Platform>
|
7
7
|
</ProjectConfiguration>
|
8
|
+
<ProjectConfiguration Include="Debug|x64">
|
9
|
+
<Configuration>Debug</Configuration>
|
10
|
+
<Platform>x64</Platform>
|
11
|
+
</ProjectConfiguration>
|
8
12
|
<ProjectConfiguration Include="Release|Win32">
|
9
13
|
<Configuration>Release</Configuration>
|
10
14
|
<Platform>Win32</Platform>
|
11
15
|
</ProjectConfiguration>
|
16
|
+
<ProjectConfiguration Include="Release|x64">
|
17
|
+
<Configuration>Release</Configuration>
|
18
|
+
<Platform>x64</Platform>
|
19
|
+
</ProjectConfiguration>
|
12
20
|
</ItemGroup>
|
13
21
|
<PropertyGroup Label="Globals">
|
14
22
|
<ProjectGuid>{6DCFD1E6-224E-479C-BBD9-B6931DFCD02C}</ProjectGuid>
|
15
23
|
<RootNamespace>libxsl</RootNamespace>
|
16
24
|
<Keyword>Win32Proj</Keyword>
|
25
|
+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
17
26
|
</PropertyGroup>
|
18
27
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
19
28
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
20
29
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
21
30
|
<CharacterSet>Unicode</CharacterSet>
|
22
31
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
32
|
+
<PlatformToolset>v142</PlatformToolset>
|
33
|
+
</PropertyGroup>
|
34
|
+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
35
|
+
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
36
|
+
<CharacterSet>Unicode</CharacterSet>
|
37
|
+
<WholeProgramOptimization>true</WholeProgramOptimization>
|
38
|
+
<PlatformToolset>v142</PlatformToolset>
|
23
39
|
</PropertyGroup>
|
24
40
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
25
41
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
26
42
|
<CharacterSet>Unicode</CharacterSet>
|
43
|
+
<PlatformToolset>v142</PlatformToolset>
|
44
|
+
</PropertyGroup>
|
45
|
+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
46
|
+
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
47
|
+
<CharacterSet>Unicode</CharacterSet>
|
48
|
+
<PlatformToolset>v142</PlatformToolset>
|
27
49
|
</PropertyGroup>
|
28
50
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
29
51
|
<ImportGroup Label="ExtensionSettings">
|
@@ -31,25 +53,38 @@
|
|
31
53
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
32
54
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
33
55
|
</ImportGroup>
|
56
|
+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
57
|
+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
58
|
+
</ImportGroup>
|
34
59
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
35
60
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
36
61
|
</ImportGroup>
|
62
|
+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
63
|
+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
64
|
+
</ImportGroup>
|
37
65
|
<PropertyGroup Label="UserMacros" />
|
38
66
|
<PropertyGroup>
|
39
67
|
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
40
68
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\MinGW\local\src\libxslt-ruby\lib\1.8</OutDir>
|
41
69
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
42
70
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
71
|
+
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
43
72
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
44
73
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
45
74
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
75
|
+
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
46
76
|
<TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.so</TargetExt>
|
77
|
+
<TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.so</TargetExt>
|
47
78
|
<TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.so</TargetExt>
|
79
|
+
<TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.so</TargetExt>
|
80
|
+
</PropertyGroup>
|
81
|
+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
82
|
+
<OutDir>..\..\lib\2.7</OutDir>
|
48
83
|
</PropertyGroup>
|
49
84
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
50
85
|
<ClCompile>
|
51
86
|
<Optimization>Disabled</Optimization>
|
52
|
-
<AdditionalIncludeDirectories>C:\
|
87
|
+
<AdditionalIncludeDirectories>C:\msys64\usr\local\ruby-2.7.1vc\include\ruby-2.7.0;C:\msys64\usr\local\ruby-2.7.1vc\include\ruby-2.7.0\x64-mswin64_140;D:\src\libxml-ruby\ext\libxml;C:\msys64\mingw64\include\libxml2;C:\msys64\mingw64\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
53
88
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;libxsl_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
54
89
|
<MinimalRebuild>true</MinimalRebuild>
|
55
90
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
@@ -60,9 +95,9 @@
|
|
60
95
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
61
96
|
</ClCompile>
|
62
97
|
<Link>
|
63
|
-
<AdditionalDependencies>
|
98
|
+
<AdditionalDependencies>x64-vcruntime140-ruby270.lib;libxml2.lib;libxslt.lib;libxml_ruby.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
64
99
|
<OutputFile>$(OutDir)\$(TargetName)$(TargetExt)</OutputFile>
|
65
|
-
<AdditionalLibraryDirectories>C:\
|
100
|
+
<AdditionalLibraryDirectories>C:\msys64\usr\local\ruby-2.7.1vc\lib;C:\msys64\mingw64\lib;D:\src\libxml-ruby\lib\2.7;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
66
101
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
67
102
|
<SubSystem>Windows</SubSystem>
|
68
103
|
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
@@ -71,6 +106,30 @@
|
|
71
106
|
<TargetMachine>MachineX86</TargetMachine>
|
72
107
|
</Link>
|
73
108
|
</ItemDefinitionGroup>
|
109
|
+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
110
|
+
<ClCompile>
|
111
|
+
<Optimization>Disabled</Optimization>
|
112
|
+
<AdditionalIncludeDirectories>C:\msys64\usr\local\ruby-2.7.1vc\include\ruby-2.7.0;C:\msys64\usr\local\ruby-2.7.1vc\include\ruby-2.7.0\x64-mswin64_140;D:\src\libxml-ruby\ext\libxml;C:\msys64\mingw64\include\libxml2;C:\msys64\mingw64\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
113
|
+
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;libxsl_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
114
|
+
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
115
|
+
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
116
|
+
<PrecompiledHeader>
|
117
|
+
</PrecompiledHeader>
|
118
|
+
<WarningLevel>Level3</WarningLevel>
|
119
|
+
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
120
|
+
</ClCompile>
|
121
|
+
<Link>
|
122
|
+
<AdditionalDependencies>x64-vcruntime140-ruby270.lib;libxml2.lib;libxslt.lib;libexslt.lib;libxml_ruby.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
123
|
+
<OutputFile>$(OutDir)\$(TargetName)$(TargetExt)</OutputFile>
|
124
|
+
<AdditionalLibraryDirectories>C:\msys64\usr\local\ruby-2.7.1vc\lib;C:\msys64\mingw64\lib;D:\src\libxml-ruby\lib\2.7;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
125
|
+
<GenerateDebugInformation>true</GenerateDebugInformation>
|
126
|
+
<SubSystem>Windows</SubSystem>
|
127
|
+
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
128
|
+
<DataExecutionPrevention>
|
129
|
+
</DataExecutionPrevention>
|
130
|
+
<ModuleDefinitionFile>..\libxslt\libxslt_ruby.def</ModuleDefinitionFile>
|
131
|
+
</Link>
|
132
|
+
</ItemDefinitionGroup>
|
74
133
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
75
134
|
<ClCompile>
|
76
135
|
<AdditionalIncludeDirectories>C:\Development\msys\src\libiconv-1.12\include;C:\Development\ruby\lib\ruby\1.8\i386-mswin32;C:\Development\msys\src\libxml2-2.6.32\include;C:\Development\msys\src\libxslt-1.1.24;C:\Development\msys\src\rlibxml\ext;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
@@ -95,12 +154,37 @@
|
|
95
154
|
<TargetMachine>MachineX86</TargetMachine>
|
96
155
|
</Link>
|
97
156
|
</ItemDefinitionGroup>
|
157
|
+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
158
|
+
<ClCompile>
|
159
|
+
<AdditionalIncludeDirectories>C:\Development\msys\src\libiconv-1.12\include;C:\Development\ruby\lib\ruby\1.8\i386-mswin32;C:\Development\msys\src\libxml2-2.6.32\include;C:\Development\msys\src\libxslt-1.1.24;C:\Development\msys\src\rlibxml\ext;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
160
|
+
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBXML_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
161
|
+
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
162
|
+
<PrecompiledHeader>
|
163
|
+
</PrecompiledHeader>
|
164
|
+
<WarningLevel>Level3</WarningLevel>
|
165
|
+
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
166
|
+
</ClCompile>
|
167
|
+
<Link>
|
168
|
+
<AdditionalDependencies>msvcrt-ruby18.lib;libxml2.lib;libxslt.lib;libexslt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
169
|
+
<OutputFile>$(OutDir)$(ProjectName).so</OutputFile>
|
170
|
+
<AdditionalLibraryDirectories>C:\Development\ruby\lib;C:\Development\msys\src\libxslt-1.1.24\win32\bin.msvc;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
171
|
+
<GenerateDebugInformation>true</GenerateDebugInformation>
|
172
|
+
<SubSystem>Windows</SubSystem>
|
173
|
+
<OptimizeReferences>true</OptimizeReferences>
|
174
|
+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
175
|
+
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
176
|
+
<DataExecutionPrevention>
|
177
|
+
</DataExecutionPrevention>
|
178
|
+
</Link>
|
179
|
+
</ItemDefinitionGroup>
|
98
180
|
<ItemGroup>
|
99
181
|
<ClCompile Include="..\libxslt\libxslt.c" />
|
182
|
+
<ClCompile Include="..\libxslt\ruby_exslt.c" />
|
100
183
|
<ClCompile Include="..\libxslt\ruby_xslt_stylesheet.c" />
|
101
184
|
</ItemGroup>
|
102
185
|
<ItemGroup>
|
103
186
|
<ClInclude Include="..\libxslt\libxslt.h" />
|
187
|
+
<ClInclude Include="..\libxslt\ruby_exslt.h" />
|
104
188
|
<ClInclude Include="..\libxslt\ruby_xslt_stylesheet.h" />
|
105
189
|
<ClInclude Include="..\libxslt\version.h" />
|
106
190
|
</ItemGroup>
|
data/lib/libxslt-ruby.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
# Load the libxml bindings
|
4
|
+
require 'libxml'
|
5
|
+
|
6
|
+
# Load the C-based binding.
|
7
|
+
begin
|
8
|
+
RUBY_VERSION =~ /(\d+.\d+)/
|
9
|
+
require "#{$1}/libxslt_ruby"
|
10
|
+
rescue LoadError
|
11
|
+
require "libxslt_ruby"
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'libxslt/stylesheet'
|
data/lib/libxslt.rb
CHANGED
@@ -1,16 +1,3 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
|
4
|
-
require 'libxml'
|
5
|
-
|
6
|
-
# Load the C-based binding.
|
7
|
-
begin
|
8
|
-
RUBY_VERSION =~ /(\d+.\d+)/
|
9
|
-
require "#{$1}/libxslt_ruby"
|
10
|
-
rescue LoadError
|
11
|
-
require "libxslt_ruby"
|
12
|
-
end
|
13
|
-
|
14
|
-
# And add support for deprecated functions
|
15
|
-
require 'libxslt/deprecated'
|
16
|
-
require 'libxslt/stylesheet'
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'libxslt-ruby'
|
data/lib/libxslt/stylesheet.rb
CHANGED
@@ -1,30 +1,32 @@
|
|
1
|
-
module LibXSLT
|
2
|
-
module XSLT
|
3
|
-
class Stylesheet
|
4
|
-
# options to be used for parsing stylesheets
|
5
|
-
PARSE_OPTIONS = LibXML::XML::Parser::Options::NOCDATA | LibXML::XML::Parser::Options::NOENT
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
1
|
+
module LibXSLT
|
2
|
+
module XSLT
|
3
|
+
class Stylesheet
|
4
|
+
# options to be used for parsing stylesheets
|
5
|
+
PARSE_OPTIONS = LibXML::XML::Parser::Options::NOCDATA | LibXML::XML::Parser::Options::NOENT
|
6
|
+
|
7
|
+
# create a xslt stylesheet from a string
|
8
|
+
def self.string(xml)
|
9
|
+
doc = LibXML::XML::Parser.string(xml, :options => PARSE_OPTIONS).parse
|
10
|
+
return new(doc)
|
11
|
+
end
|
12
|
+
|
13
|
+
# create a xslt stylesheet from a file specified by its filename
|
14
|
+
def self.file(filename)
|
15
|
+
doc = LibXML::XML::Parser.file(filename, :options => PARSE_OPTIONS).parse
|
16
|
+
return new(doc)
|
17
|
+
end
|
18
|
+
|
19
|
+
# create a xslt stylesheet from an io object
|
20
|
+
def self.io(io_object)
|
21
|
+
doc = LibXML::XML::Parser.io(io_object, :options => PARSE_OPTIONS).parse
|
22
|
+
return new(doc)
|
23
|
+
end
|
24
|
+
|
25
|
+
# transform a xml to a string
|
26
|
+
def transform(doc)
|
27
|
+
return output(apply(doc))
|
28
|
+
end
|
29
|
+
# transform a xml to a file (specified by an output stream)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/xslt.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
# This file loads libxslt and adds the LibXSLT namespace
|
2
|
-
# to the toplevel for conveneience. The end result
|
3
|
-
# is to have XSLT:: universally exposed.
|
4
|
-
#
|
5
|
-
# It is recommend that you only load this file for libs
|
6
|
-
# that do not have their own namespace, eg. administrative
|
7
|
-
# scripts, personal programs, etc. For other applications
|
8
|
-
# require 'libxslt' instead and include LibXSLT into your
|
9
|
-
# app/libs namespace.
|
10
|
-
|
11
|
-
require 'libxslt'
|
12
|
-
|
13
|
-
include LibXML
|
14
|
-
include LibXSLT
|
15
|
-
|
1
|
+
# This file loads libxslt and adds the LibXSLT namespace
|
2
|
+
# to the toplevel for conveneience. The end result
|
3
|
+
# is to have XSLT:: universally exposed.
|
4
|
+
#
|
5
|
+
# It is recommend that you only load this file for libs
|
6
|
+
# that do not have their own namespace, eg. administrative
|
7
|
+
# scripts, personal programs, etc. For other applications
|
8
|
+
# require 'libxslt' instead and include LibXSLT into your
|
9
|
+
# app/libs namespace.
|
10
|
+
|
11
|
+
require 'libxslt'
|
12
|
+
|
13
|
+
include LibXML
|
14
|
+
include LibXSLT
|
15
|
+
|
data/libxslt-ruby.gemspec
CHANGED
@@ -1,43 +1,45 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
|
4
|
-
version
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
spec.
|
9
|
-
spec.
|
10
|
-
spec.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
spec.
|
18
|
-
spec.
|
19
|
-
spec.
|
20
|
-
spec.
|
21
|
-
spec.
|
22
|
-
|
23
|
-
|
24
|
-
spec.
|
25
|
-
spec.
|
26
|
-
|
27
|
-
'
|
28
|
-
'
|
29
|
-
'
|
30
|
-
'
|
31
|
-
'
|
32
|
-
'
|
33
|
-
'
|
34
|
-
'ext/libxslt/*.
|
35
|
-
'ext/
|
36
|
-
'ext/vc/*.
|
37
|
-
'
|
38
|
-
|
39
|
-
spec.
|
40
|
-
spec.
|
41
|
-
spec.
|
42
|
-
spec.
|
43
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'date'
|
3
|
+
|
4
|
+
# Determine the current version of the software
|
5
|
+
version = File.read('ext/libxslt/version.h').match(/\s*RUBY_LIBXSLT_VERSION\s*['"](\d.+)['"]/)[1]
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = "libxslt-ruby"
|
9
|
+
spec.homepage = "http://libxslt.rubyforge.org/"
|
10
|
+
spec.summary = "Ruby libxslt bindings"
|
11
|
+
spec.description = <<-EOF
|
12
|
+
The Libxslt-Ruby project provides Ruby language bindings for the GNOME
|
13
|
+
XSLT C library. It is free software, released under the MIT License.
|
14
|
+
EOF
|
15
|
+
|
16
|
+
# Determine the current version of the software
|
17
|
+
spec.version = version
|
18
|
+
spec.author = "Charlie Savage"
|
19
|
+
spec.email = "libxml-devel@rubyforge.org"
|
20
|
+
spec.add_dependency('libxml-ruby','>=2.4.0')
|
21
|
+
spec.platform = Gem::Platform::RUBY
|
22
|
+
spec.require_paths = ["lib", "ext/libxslt"]
|
23
|
+
|
24
|
+
spec.bindir = "bin"
|
25
|
+
spec.extensions = ["ext/libxslt/extconf.rb"]
|
26
|
+
spec.files = Dir.glob(['CHANGES',
|
27
|
+
'LICENSE',
|
28
|
+
'Rakefile',
|
29
|
+
'README.rdoc',
|
30
|
+
'libxslt-ruby.gemspec',
|
31
|
+
'setup.rb',
|
32
|
+
'doc/**/*',
|
33
|
+
'lib/**/*.rb',
|
34
|
+
'ext/libxslt/*.h',
|
35
|
+
'ext/libxslt/*.c',
|
36
|
+
'ext/vc/*.sln',
|
37
|
+
'ext/vc/*.vcxproj',
|
38
|
+
'test/**/*'])
|
39
|
+
spec.test_files = Dir.glob("test/test_*.rb")
|
40
|
+
spec.add_development_dependency 'minitest'
|
41
|
+
spec.add_development_dependency 'rake'
|
42
|
+
spec.add_development_dependency 'rake-compiler'
|
43
|
+
spec.required_ruby_version = '>= 2.5.0'
|
44
|
+
spec.date = DateTime.now
|
45
|
+
end
|