libxslt-ruby 0.8.2 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/Rakefile +16 -37
  2. data/ext/libxslt/extconf.rb +18 -0
  3. data/ext/libxslt/libxslt.c +3 -0
  4. data/ext/libxslt/libxslt.h +1 -1
  5. data/ext/libxslt/ruby_xslt_stylesheet.c +6 -6
  6. data/ext/libxslt/version.h +3 -3
  7. data/ext/mingw/Rakefile +18 -32
  8. data/ext/vc/libxslt_ruby.vcproj +2 -2
  9. data/test/files/commentary.dtd +34 -0
  10. data/{lib/text.xml → test/files/fuzface.xml} +154 -129
  11. data/test/files/fuzface.xsl +4 -0
  12. data/test/files/params.xml +2 -0
  13. data/test/files/params.xsl +11 -0
  14. data/test/files/ramblings.xsl +46 -0
  15. data/test/test_deprecated.rb +97 -0
  16. data/test/test_libxslt.rb +21 -0
  17. data/test/test_stylesheet.rb +108 -0
  18. data/test/test_suite.rb +3 -0
  19. metadata +14 -33
  20. data/doc/classes/LibXSLT.html +0 -126
  21. data/doc/classes/LibXSLT/XSLT.html +0 -196
  22. data/doc/classes/LibXSLT/XSLT/Stylesheet.html +0 -250
  23. data/doc/classes/LibXSLT/XSLT/TransformContext.html +0 -117
  24. data/doc/classes/LibXSLT/XSLTError.html +0 -131
  25. data/doc/classes/XSLT.html +0 -125
  26. data/doc/created.rid +0 -1
  27. data/doc/files/CHANGES.html +0 -204
  28. data/doc/files/LICENSE.html +0 -133
  29. data/doc/files/README.html +0 -302
  30. data/doc/files/ext/libxslt/libxslt_c.html +0 -101
  31. data/doc/files/ext/libxslt/ruby_xslt_stylesheet_c.html +0 -101
  32. data/doc/files/ext/libxslt/ruby_xslt_transform_context_c.html +0 -101
  33. data/doc/files/lib/libxslt/deprecated_rb.html +0 -101
  34. data/doc/files/lib/libxslt_rb.html +0 -116
  35. data/doc/files/lib/xslt_rb.html +0 -135
  36. data/doc/fr_class_index.html +0 -32
  37. data/doc/fr_file_index.html +0 -35
  38. data/doc/fr_method_index.html +0 -28
  39. data/doc/index.html +0 -24
  40. data/doc/rdoc-style.css +0 -208
@@ -1,133 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>File: LICENSE</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="fileHeader">
50
- <h1>LICENSE</h1>
51
- <table class="header-table">
52
- <tr class="top-aligned-row">
53
- <td><strong>Path:</strong></td>
54
- <td>LICENSE
55
- </td>
56
- </tr>
57
- <tr class="top-aligned-row">
58
- <td><strong>Last Update:</strong></td>
59
- <td>Sat Jul 19 17:20:44 -0600 2008</td>
60
- </tr>
61
- </table>
62
- </div>
63
- <!-- banner header -->
64
-
65
- <div id="bodyContent">
66
-
67
-
68
-
69
- <div id="contextContent">
70
-
71
- <div id="description">
72
- <p>
73
- # $Id: LICENSE 33 2007-08-29 18:18:15Z transami $
74
- </p>
75
- <p>
76
- Copyright (c) 2002-2006 Sean Chittenden &lt;sean@chittenden.org&gt; and
77
- contributors
78
- </p>
79
- <p>
80
- Permission is hereby granted, free of charge, to any person obtaining a
81
- copy of this software and associated documentation files (the
82
- &quot;Software&quot;), to deal in the Software without restriction,
83
- including without limitation the rights to use, copy, modify, merge,
84
- publish, distribute, sublicense, and/or sell copies of the Software, and to
85
- permit persons to whom the Software is furnished to do so, subject to the
86
- following conditions:
87
- </p>
88
- <p>
89
- The above copyright notice and this permission notice shall be included in
90
- all copies or substantial portions of the Software.
91
- </p>
92
- <p>
93
- THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
94
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
95
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
96
- NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
97
- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
98
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
99
- USE OR OTHER DEALINGS IN THE SOFTWARE.
100
- </p>
101
-
102
- </div>
103
-
104
-
105
- </div>
106
-
107
-
108
- </div>
109
-
110
-
111
- <!-- if includes -->
112
-
113
- <div id="section">
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
- <!-- if method_list -->
123
-
124
-
125
- </div>
126
-
127
-
128
- <div id="validator-badges">
129
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
130
- </div>
131
-
132
- </body>
133
- </html>
@@ -1,302 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>File: README</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="fileHeader">
50
- <h1>README</h1>
51
- <table class="header-table">
52
- <tr class="top-aligned-row">
53
- <td><strong>Path:</strong></td>
54
- <td>README
55
- </td>
56
- </tr>
57
- <tr class="top-aligned-row">
58
- <td><strong>Last Update:</strong></td>
59
- <td>Mon Jul 21 20:44:12 -0600 2008</td>
60
- </tr>
61
- </table>
62
- </div>
63
- <!-- banner header -->
64
-
65
- <div id="bodyContent">
66
-
67
-
68
-
69
- <div id="contextContent">
70
-
71
- <div id="description">
72
- <h1>libxslt-ruby</h1>
73
- <h2>Overview</h2>
74
- <p>
75
- The libxslt gem provides Ruby language bindings for GNOME&#8216;s Libxslt
76
- toolkit. It is free software, released under the MIT License.
77
- </p>
78
- <h2>Requirements</h2>
79
- <p>
80
- libxslt-ruby requires Ruby 1.8.4 or higher. It is dependent on the
81
- following libraries to function properly:
82
- </p>
83
- <ul>
84
- <li>libm (math routines: very standard)
85
-
86
- </li>
87
- <li>libz (zlib)
88
-
89
- </li>
90
- <li>libiconv
91
-
92
- </li>
93
- <li>libxml2
94
-
95
- </li>
96
- <li>libxslt
97
-
98
- </li>
99
- <li>libxml-ruby bindings
100
-
101
- </li>
102
- </ul>
103
- <p>
104
- If you are running Linux or Unix you&#8216;ll need a C compiler so the
105
- extension can be compiled when it is installed. If you are running Windows,
106
- then install the Windows specific RubyGem which includes an already built
107
- extension.
108
- </p>
109
- <p>
110
- !!!NOTE!!! The libxml-ruby and libxslt-ruby bindings must absolutely,
111
- positively, without a doubt share the same libxml2 library. This is because
112
- libxslt modifies XML documents created by libxml2. If there are two copies
113
- of libxml2 on your system, then when XML documents allocated in copy 1 are
114
- manipulated by copy 2, a segmentation fault will occur. So make sure that
115
- your system has only one copy of libxml2 installed.
116
- </p>
117
- <h2>INSTALLATION</h2>
118
- <p>
119
- The easiest way to install libxslt-ruby is via Ruby Gems. To install:
120
- </p>
121
- <p>
122
- <tt>gem install libxslt-ruby</tt>
123
- </p>
124
- <p>
125
- If you are running Windows, make sure to install the Win32 RubyGem which
126
- includes an already built binary file. The binary is built against libxml2
127
- version 2.6.32, iconv version 1.11 and libxslt version 1.1.24. Binaries for
128
- libxml2 and iconv are provided in the libxml-ruby bindings, while a binary
129
- for libxslt is provided in the libxslt-ruby bindings.
130
- </p>
131
- <p>
132
- The Windows binaries are biult with MingW. The gem also includes a
133
- Microsoft VC++ 2005 solution. If you wish to run a debug version of
134
- libxml-ruby on Windows, then it is highly recommended you use VC++.
135
- </p>
136
- <h2>USAGE</h2>
137
- <p>
138
- For in-depth information about using libxslt-ruby please refer to its
139
- online Rdoc documentation.
140
- </p>
141
- <p>
142
- All libxslt classes are in the <a
143
- href="../classes/LibXSLT/XSLT.html">LibXSLT::XSLT</a> module. The simplest
144
- way to use libxslt is to require &#8216;xslt&#8217;. This will mixin the
145
- LibXML and <a href="../classes/LibXSLT.html">LibXSLT</a> modules into the
146
- global namespace, allowing you to write code like this:
147
- </p>
148
- <p>
149
- require &#8216;xslt&#8217; document = XML::Document.new stylesheett =
150
- XSLT::Stylesheet.new(document)
151
- </p>
152
- <p>
153
- If you prefer not to add the <a href="../classes/LibXSLT.html">LibXSLT</a>
154
- module to the global namepace, then write your code like this:
155
- </p>
156
- <p>
157
- require &#8216;libxslt&#8216;
158
- </p>
159
- <p>
160
- class MyClass
161
- </p>
162
- <pre>
163
- def some_method
164
- document = LibXML::XML::Document.new
165
- stylesheett = LibXSLT::XSLT::Stylesheet.new(document)
166
- end
167
- </pre>
168
- <p>
169
- end
170
- </p>
171
- <p>
172
- Given an XML file like:
173
- </p>
174
- <pre>
175
- &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
176
- &lt;?xml-stylesheet href=&quot;fuzface.xsl&quot; type=&quot;text/xsl&quot;?&gt;
177
-
178
- &lt;commentary&gt;
179
- &lt;meta&gt;
180
- &lt;author&gt;
181
- &lt;first_name&gt;Sean&lt;/first_name&gt;
182
- &lt;last_name&gt;Chittenden&lt;/last_name&gt;
183
- &lt;email&gt;sean@chittenden.org&lt;/email&gt;
184
- &lt;/author&gt;
185
- &lt;version&gt;$Version$&lt;/version&gt;
186
- &lt;date&gt;$Date: 2008-07-21 20:44:12 -0600 (Mon, 21 Jul 2008) $&lt;/date&gt;
187
- &lt;id&gt;$Id: README 109 2008-07-22 02:44:12Z cfis $&lt;/id&gt; &lt;title&gt;Fuzface...&lt;/title&gt;
188
- &lt;subtitle&gt;The Internet's a big place and here's some proof...&lt;/subtitle&gt;
189
- &lt;/meta&gt;
190
-
191
- &lt;body&gt;
192
- &lt;para&gt;
193
- I think it's a tragedy that I'm going to start off my new
194
- commentary by talking about facial hair and the Internet.
195
- Something about that just screams pathetic, but whatever: it's
196
- humor and that's life.
197
- &lt;/para&gt;
198
- &lt;/body&gt;
199
- &lt;/commentary&gt;
200
- </pre>
201
- <p>
202
- And an <a href="../classes/XSLT.html">XSLT</a> file like this:
203
- </p>
204
- <pre>
205
- &lt;?xml version=&quot;1.0&quot; ?&gt;
206
- &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;1.0&quot;&gt;
207
- &lt;xsl:template match=&quot;/&quot;&gt;
208
- &lt;xsl:element name=&quot;html&quot;&gt;
209
- &lt;xsl:element name=&quot;head&quot;&gt;
210
- &lt;xsl:element name=&quot;title&quot;&gt;Ramblings - &lt;xsl:value-of select=&quot;commentary/meta/title&quot; /&gt; - &lt;xsl:value-of select=&quot;commentary/meta/subtitle&quot; /&gt;&lt;/xsl:element&gt;
211
- &lt;/xsl:element&gt;
212
-
213
- &lt;xsl:element name=&quot;body&quot;&gt;
214
- &lt;xsl:element name=&quot;h1&quot;&gt;&lt;xsl:value-of select=&quot;commentary/meta/title&quot; /&gt;&lt;/xsl:element&gt;
215
- &lt;xsl:element name=&quot;h3&quot;&gt;&lt;xsl:value-of select=&quot;commentary/meta/subtitle&quot; /&gt;&lt;/xsl:element&gt;
216
- By: &lt;xsl:value-of select=&quot;commentary/meta/author/first_name&quot; /&gt; &lt;xsl:value-of select=&quot;commentary/meta/author/last_name&quot; /&gt;&lt;xsl:element name=&quot;br&quot; /&gt;
217
- Date: &lt;xsl:value-of select=&quot;commentary/meta/date&quot; /&gt;&lt;xsl:element name=&quot;br&quot; /&gt;
218
-
219
- &lt;xsl:for-each select=&quot;./commentary/body&quot;&gt;
220
- &lt;xsl:apply-templates /&gt;
221
- &lt;/xsl:for-each&gt;
222
-
223
- &lt;/xsl:element&gt;
224
- &lt;/xsl:element&gt;
225
- &lt;/xsl:template&gt;
226
-
227
- &lt;xsl:template match=&quot;para&quot;&gt;
228
- &lt;xsl:element name=&quot;p&quot;&gt;
229
- &lt;xsl:value-of select=&quot;.&quot; /&gt;
230
- &lt;/xsl:element&gt;
231
- &lt;/xsl:template&gt;
232
- &lt;/xsl:stylesheet&gt;
233
- </pre>
234
- <p>
235
- We can easily transform the XML with the following ruby code:
236
- </p>
237
- <pre>
238
- require 'xslt'
239
-
240
- # Create a new XSL Transform
241
- stylesheet_doc = XML::Document.file('files/fuzface.xsl')
242
- stylesheet = LibXSLT::Stylesheet.new(stylesheet_doc)
243
-
244
- # Transform a xml document
245
- xml_doc = XML::Document.file('files/fuzface.xml')
246
- result = stylesheet.apply(xml_doc)
247
- </pre>
248
- <p>
249
- You can then print, save or manipulate the returned document.
250
- </p>
251
- <h2>License</h2>
252
- <p>
253
- See LICENSE for license information.
254
- </p>
255
- <h2>DOCUMENTATION</h2>
256
- <p>
257
- RDoc comments are included - run &#8216;rake doc&#8217; to generate
258
- documentation. You can find the latest documentation at:
259
- </p>
260
- <ul>
261
- <li><a href="http://libxsl.rubyforge.org">libxsl.rubyforge.org</a>/
262
-
263
- </li>
264
- </ul>
265
- <h2>MORE INFORMATION</h2>
266
- <p>
267
- For more information please refer to the documentation. If you have any
268
- questions, please send email to libxml-devel@rubyforge.org.
269
- </p>
270
-
271
- </div>
272
-
273
-
274
- </div>
275
-
276
-
277
- </div>
278
-
279
-
280
- <!-- if includes -->
281
-
282
- <div id="section">
283
-
284
-
285
-
286
-
287
-
288
-
289
-
290
-
291
- <!-- if method_list -->
292
-
293
-
294
- </div>
295
-
296
-
297
- <div id="validator-badges">
298
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
299
- </div>
300
-
301
- </body>
302
- </html>
@@ -1,101 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>File: libxslt.c</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="fileHeader">
50
- <h1>libxslt.c</h1>
51
- <table class="header-table">
52
- <tr class="top-aligned-row">
53
- <td><strong>Path:</strong></td>
54
- <td>ext/libxslt/libxslt.c
55
- </td>
56
- </tr>
57
- <tr class="top-aligned-row">
58
- <td><strong>Last Update:</strong></td>
59
- <td>Mon Jul 21 20:17:20 -0600 2008</td>
60
- </tr>
61
- </table>
62
- </div>
63
- <!-- banner header -->
64
-
65
- <div id="bodyContent">
66
-
67
-
68
-
69
- <div id="contextContent">
70
-
71
-
72
-
73
- </div>
74
-
75
-
76
- </div>
77
-
78
-
79
- <!-- if includes -->
80
-
81
- <div id="section">
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
- <!-- if method_list -->
91
-
92
-
93
- </div>
94
-
95
-
96
- <div id="validator-badges">
97
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
- </div>
99
-
100
- </body>
101
- </html>