libxslt-ruby 0.7.0-x86-mswin32-60 → 0.8.0-x86-mswin32-60
Sign up to get free protection for your applications and to get access to all the features.
- data/README +141 -141
- data/doc/classes/LibXSLT.html +120 -0
- data/doc/classes/LibXSLT/XSLT.html +207 -0
- data/doc/classes/{XSLT → LibXSLT/XSLT}/Stylesheet.html +22 -17
- data/doc/classes/LibXSLT/XSLT/TransformContext.html +111 -0
- data/doc/classes/{XSLT/TransformContext.html → LibXSLT/XSLTError.html} +5 -5
- data/doc/classes/XSLT.html +12 -103
- data/doc/created.rid +1 -1
- data/doc/files/CHANGES.html +18 -3
- data/doc/files/README.html +4 -4
- data/doc/files/ext/libxslt/libxslt_c.html +1 -1
- data/doc/files/ext/libxslt/ruby_xslt_stylesheet_c.html +1 -1
- data/doc/files/ext/libxslt/ruby_xslt_transform_context_c.html +1 -1
- data/doc/files/lib/{deprecated_rb.html → libxslt/deprecated_rb.html} +3 -3
- data/doc/files/lib/libxslt_rb.html +3 -3
- data/doc/fr_class_index.html +5 -2
- data/doc/fr_file_index.html +1 -1
- data/doc/fr_method_index.html +2 -2
- data/ext/libxslt/libxslt.c +22 -18
- data/ext/libxslt/libxslt.h +4 -6
- data/ext/libxslt/ruby_xslt_stylesheet.c +59 -41
- data/ext/libxslt/ruby_xslt_transform_context.c +3 -3
- data/ext/libxslt/version.h +2 -2
- data/lib/libxslt.rb +8 -2
- data/lib/libxslt/deprecated.rb +66 -0
- data/lib/libxslt_ruby.so +0 -0
- data/mingw/libxslt_ruby.so +0 -0
- data/setup.rb +1585 -0
- data/vc/libxslt_ruby.vcproj +2 -2
- metadata +16 -19
- data/lib/deprecated.rb +0 -66
- data/tests/files/commentary.dtd +0 -34
- data/tests/files/fuzface.xml +0 -154
- data/tests/files/fuzface.xsl +0 -4
- data/tests/files/params.xml +0 -2
- data/tests/files/params.xsl +0 -11
- data/tests/files/ramblings.xsl +0 -46
- data/tests/test_deprecated.rb +0 -99
- data/tests/test_libxslt.rb +0 -21
- data/tests/test_stylesheet.rb +0 -64
- data/tests/test_suite.rb +0 -3
data/tests/test_libxslt.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'libxslt'
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
class TextLibXslt < Test::Unit::TestCase
|
5
|
-
def test_constants
|
6
|
-
assert_instance_of(Fixnum, XSLT::MAX_DEPTH)
|
7
|
-
assert_instance_of(Fixnum, XSLT::MAX_SORT)
|
8
|
-
assert_instance_of(String, XSLT::ENGINE_VERSION)
|
9
|
-
assert_instance_of(Fixnum, XSLT::LIBXSLT_VERSION)
|
10
|
-
assert_instance_of(Fixnum, XSLT::LIBXML_VERSION)
|
11
|
-
assert_instance_of(String, XSLT::XSLT_NAMESPACE)
|
12
|
-
assert_instance_of(String, XSLT::DEFAULT_URL)
|
13
|
-
assert_instance_of(String, XSLT::DEFAULT_VENDOR)
|
14
|
-
assert_instance_of(String, XSLT::DEFAULT_VERSION)
|
15
|
-
assert_instance_of(String, XSLT::NAMESPACE_LIBXSLT)
|
16
|
-
assert_instance_of(String, XSLT::NAMESPACE_SAXON)
|
17
|
-
assert_instance_of(String, XSLT::NAMESPACE_XT)
|
18
|
-
assert_instance_of(String, XSLT::NAMESPACE_XALAN)
|
19
|
-
assert_instance_of(String, XSLT::NAMESPACE_NORM_SAXON)
|
20
|
-
end
|
21
|
-
end
|
data/tests/test_stylesheet.rb
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
require 'libxslt'
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
class TestStylesheet < Test::Unit::TestCase
|
5
|
-
def setup
|
6
|
-
doc = XML::Document.file('files/fuzface.xsl')
|
7
|
-
@stylesheet = XSLT::Stylesheet.new(doc)
|
8
|
-
end
|
9
|
-
|
10
|
-
def tear_down
|
11
|
-
@stylesheet = nil
|
12
|
-
end
|
13
|
-
|
14
|
-
def doc
|
15
|
-
XML::Document.file('files/fuzface.xml')
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_class
|
19
|
-
assert_instance_of(XSLT::Stylesheet, @stylesheet)
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_apply
|
23
|
-
result = @stylesheet.apply(doc)
|
24
|
-
assert_instance_of(XML::Document, result)
|
25
|
-
|
26
|
-
paragraphs = result.find('//p')
|
27
|
-
assert_equal(11, paragraphs.length)
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_apply_multiple
|
31
|
-
10.times do
|
32
|
-
test_apply
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_params
|
37
|
-
sdoc = XML::Document.file('files/params.xsl')
|
38
|
-
stylesheet = XSLT::Stylesheet.new(sdoc)
|
39
|
-
doc = XML::Document.file('files/params.xml')
|
40
|
-
|
41
|
-
# Start with no params
|
42
|
-
result = stylesheet.apply(doc)
|
43
|
-
assert_equal('<article>failure</article>', result.root.to_s)
|
44
|
-
|
45
|
-
# Now try with params as hash. /doc is evaluated
|
46
|
-
# as an xpath expression
|
47
|
-
result = stylesheet.apply(doc, 'bar' => "/doc")
|
48
|
-
assert_equal('<article>abc</article>', result.root.to_s)
|
49
|
-
|
50
|
-
# Now try with params as hash. Note the double quote
|
51
|
-
# on success - we want to pass a literal string and
|
52
|
-
# not an xpath expression.
|
53
|
-
result = stylesheet.apply(doc, 'bar' => "'success'")
|
54
|
-
assert_equal('<article>success</article>', result.root.to_s)
|
55
|
-
|
56
|
-
# Now try with params as an array.
|
57
|
-
result = stylesheet.apply(doc, ['bar', "'success'"])
|
58
|
-
assert_equal('<article>success</article>', result.root.to_s)
|
59
|
-
|
60
|
-
# Now try with invalid array.
|
61
|
-
result = stylesheet.apply(doc, ['bar'])
|
62
|
-
assert_equal('<article>failure</article>', result.root.to_s)
|
63
|
-
end
|
64
|
-
end
|
data/tests/test_suite.rb
DELETED