libxml-jruby-fixed 1.0.0-jruby
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +91 -0
- data/README.txt +50 -0
- data/Rakefile +40 -0
- data/lib/libxml-jruby.rb +84 -0
- data/lib/libxml-jruby/xml.rb +1 -0
- data/lib/libxml-jruby/xml/attr.rb +46 -0
- data/lib/libxml-jruby/xml/attributes.rb +68 -0
- data/lib/libxml-jruby/xml/document.rb +52 -0
- data/lib/libxml-jruby/xml/dtd.rb +25 -0
- data/lib/libxml-jruby/xml/node.rb +285 -0
- data/lib/libxml-jruby/xml/ns.rb +19 -0
- data/lib/libxml-jruby/xml/parser.rb +121 -0
- data/lib/libxml-jruby/xml/xpath.rb +98 -0
- data/lib/libxml.rb +1 -0
- data/lib/xml.rb +13 -0
- data/lib/xml/libxml.rb +8 -0
- data/script/benchmark/depixelate.rb +633 -0
- data/script/benchmark/hamlet.xml +9055 -0
- data/script/benchmark/sock_entries.xml +507 -0
- data/script/benchmark/throughput.rb +40 -0
- data/script/benchmark/xml_benchmarks.rb +228 -0
- data/script/test +6 -0
- data/tasks/ann.rake +81 -0
- data/tasks/bones.rake +21 -0
- data/tasks/gem.rake +126 -0
- data/tasks/git.rake +41 -0
- data/tasks/manifest.rake +49 -0
- data/tasks/notes.rake +28 -0
- data/tasks/post_load.rake +39 -0
- data/tasks/rdoc.rake +51 -0
- data/tasks/rubyforge.rake +57 -0
- data/tasks/setup.rb +268 -0
- data/tasks/spec.rake +55 -0
- data/tasks/svn.rake +48 -0
- data/tasks/test.rake +38 -0
- data/test/etc_doc_to_s.rb +19 -0
- data/test/ets_copy_bug.rb +21 -0
- data/test/ets_copy_bug3.rb +38 -0
- data/test/ets_doc_file.rb +15 -0
- data/test/ets_doc_to_s.rb +21 -0
- data/test/ets_gpx.rb +26 -0
- data/test/ets_node_gc.rb +21 -0
- data/test/ets_test.xml +2 -0
- data/test/ets_tsr.rb +9 -0
- data/test/model/books.xml +147 -0
- data/test/model/default_validation_bug.rb +0 -0
- data/test/model/merge_bug_data.xml +58 -0
- data/test/model/rubynet.xml +78 -0
- data/test/model/rubynet_project +1 -0
- data/test/model/saxtest.xml +5 -0
- data/test/model/shiporder.rnc +28 -0
- data/test/model/shiporder.rng +86 -0
- data/test/model/shiporder.xml +23 -0
- data/test/model/shiporder.xsd +31 -0
- data/test/model/simple.xml +7 -0
- data/test/model/soap.xml +27 -0
- data/test/model/xinclude.xml +5 -0
- data/test/tc_attributes.rb +110 -0
- data/test/tc_deprecated_require.rb +13 -0
- data/test/tc_document.rb +97 -0
- data/test/tc_document_write.rb +139 -0
- data/test/tc_dtd.rb +70 -0
- data/test/tc_html_parser.rb +63 -0
- data/test/tc_node.rb +108 -0
- data/test/tc_node_attr.rb +176 -0
- data/test/tc_node_cdata.rb +51 -0
- data/test/tc_node_comment.rb +32 -0
- data/test/tc_node_copy.rb +40 -0
- data/test/tc_node_edit.rb +98 -0
- data/test/tc_node_set.rb +24 -0
- data/test/tc_node_set2.rb +37 -0
- data/test/tc_node_text.rb +17 -0
- data/test/tc_node_xlink.rb +28 -0
- data/test/tc_ns.rb +18 -0
- data/test/tc_parser.rb +308 -0
- data/test/tc_parser_context.rb +126 -0
- data/test/tc_properties.rb +37 -0
- data/test/tc_reader.rb +112 -0
- data/test/tc_relaxng.rb +39 -0
- data/test/tc_sax_parser.rb +113 -0
- data/test/tc_schema.rb +39 -0
- data/test/tc_traversal.rb +220 -0
- data/test/tc_well_formed.rb +11 -0
- data/test/tc_xinclude.rb +26 -0
- data/test/tc_xpath.rb +130 -0
- data/test/tc_xpath_context.rb +72 -0
- data/test/tc_xpointer.rb +78 -0
- data/test/test_libxml-jruby.rb +0 -0
- data/test/test_suite.rb +31 -0
- data/test/ts_working.rb +31 -0
- metadata +146 -0
File without changes
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<template>
|
3
|
+
<body>
|
4
|
+
<section>
|
5
|
+
<txt>Some Preset Data Here</txt>
|
6
|
+
<txt>Some Preset Data Here</txt>
|
7
|
+
<txt>name: quack!</txt>
|
8
|
+
<txt>Some Preset Data Here</txt>
|
9
|
+
<txt>Some Preset Data Here</txt>
|
10
|
+
<txt>Some Preset Data Here</txt>
|
11
|
+
<txt>Some Preset Data Here</txt>
|
12
|
+
<txt>city: quack!</txt>
|
13
|
+
<txt>Some Preset Data Here</txt>
|
14
|
+
<txt>Some Preset Data Here</txt>
|
15
|
+
<txt>Some Preset Data Here</txt>
|
16
|
+
<txt>Some Preset Data Here</txt>
|
17
|
+
<txt>state: quack!</txt>
|
18
|
+
<txt>Some Preset Data Here</txt>
|
19
|
+
<txt>Some Preset Data Here</txt>
|
20
|
+
<txt>Some Preset Data Here</txt>
|
21
|
+
<txt>Some Preset Data Here</txt>
|
22
|
+
<row>
|
23
|
+
<txt>year: Vroom!</txt>
|
24
|
+
<txt>make: Vroom!</txt>
|
25
|
+
<txt>model: Vroom!</txt>
|
26
|
+
</row>
|
27
|
+
<row>
|
28
|
+
<txt>year: Vroom!</txt>
|
29
|
+
<txt>make: Vroom!</txt>
|
30
|
+
<txt>model: Vroom!</txt>
|
31
|
+
</row>
|
32
|
+
<row>
|
33
|
+
<txt>year: Vroom!</txt>
|
34
|
+
<txt>make: Vroom!</txt>
|
35
|
+
<txt>model: Vroom!</txt>
|
36
|
+
</row>
|
37
|
+
<txt>Some Preset Data Here</txt>
|
38
|
+
<txt>Some Preset Data Here</txt>
|
39
|
+
<row>
|
40
|
+
<txt>year: Vroom!</txt>
|
41
|
+
<txt>make: Vroom!</txt>
|
42
|
+
<txt>model: Vroom!</txt>
|
43
|
+
</row>
|
44
|
+
<row>
|
45
|
+
<txt>year: Vroom!</txt>
|
46
|
+
<txt>make: Vroom!</txt>
|
47
|
+
<txt>model: Vroom!</txt>
|
48
|
+
</row>
|
49
|
+
<row>
|
50
|
+
<txt>year: Vroom!</txt>
|
51
|
+
<txt>make: Vroom!</txt>
|
52
|
+
<txt>model: Vroom!</txt>
|
53
|
+
</row>
|
54
|
+
<txt>Some Preset Data Here</txt>
|
55
|
+
<txt>Some Preset Data Here</txt>
|
56
|
+
</section>
|
57
|
+
</body>
|
58
|
+
</template>
|
@@ -0,0 +1,78 @@
|
|
1
|
+
<rubynet xmlns:xlink="http://www.w3.org/1999/xlink">
|
2
|
+
<pkg version="1.0">
|
3
|
+
<meta>
|
4
|
+
<pkgname>REXML</pkgname>
|
5
|
+
<authors>
|
6
|
+
<author>
|
7
|
+
<name>Aaron Malone</name>
|
8
|
+
<email>aaron@munge.net</email>
|
9
|
+
<irc_network>irc.opentprojects.org</irc_network>
|
10
|
+
<irc_channel>#ruby-lang</irc_channel>
|
11
|
+
<irc_handle>AAmalone</irc_handle>
|
12
|
+
</author>
|
13
|
+
</authors>
|
14
|
+
<maintainers>
|
15
|
+
<maintainer>
|
16
|
+
<name>Tools Team</name>
|
17
|
+
<email>tools@gentoo.org</email>
|
18
|
+
<irc_network>irc.opentprojects.org</irc_network>
|
19
|
+
<irc_channel>#ruby-lang</irc_channel>
|
20
|
+
<irc_handle>TinyT</irc_handle>
|
21
|
+
</maintainer>
|
22
|
+
</maintainers>
|
23
|
+
<categories>
|
24
|
+
|
25
|
+
<!-- For pieces of data that are repeated constnatly, could we
|
26
|
+
use XLink to centralize some of these definitions? If we move
|
27
|
+
stuff around on rubynet.org, we don't want to have to do a
|
28
|
+
search/replace: just update the entity, IMHO. -->
|
29
|
+
|
30
|
+
<major_category xlink:type="simple" xlink:href="http://www.rubynet.org/category/xml/">XML</major_category>
|
31
|
+
<minor_category xlink:type="simple" xlink:href="http://www.rubynet.org/category/text%20processing/">Text Processing</minor_category>
|
32
|
+
<minor_category xlink:type="simple" xlink:href="http://www.rubynet.org/category/storage/">Storage</minor_category>
|
33
|
+
</categories>
|
34
|
+
<version>
|
35
|
+
<major_version>1</major_version>
|
36
|
+
<minor_version>2</minor_version>
|
37
|
+
<micro_version>3</micro_version>
|
38
|
+
</version>
|
39
|
+
<copyright>1999-2002 Gentoo Technologies,Inc.</copyright>
|
40
|
+
<license>Ruby</license>
|
41
|
+
<status>Stable</status>
|
42
|
+
<full_name>Ruby Electric XML</full_name>
|
43
|
+
<description>Pure Ruby parser, blah blah. Based of Electrice XML</description>
|
44
|
+
<homepage xlink:type="simple" xlink:href="http://www.germane-software.com/~ser/Software/rexml/">REXML Home</homepage>
|
45
|
+
<download xlink:type="simple" xlink:href="http://www.germane-software.com/~ser/Software/rexml/rexml-1.2.3.bz2/">REXML Download</download>
|
46
|
+
</meta>
|
47
|
+
<dependencies>
|
48
|
+
<dependency name="ruby" uri="http://www.rubynet.org/packages/ruby/">
|
49
|
+
<required_version restriction="no-lower-than">
|
50
|
+
<version>
|
51
|
+
<major_version>1</major_version>
|
52
|
+
<minor_version>6</minor_version>
|
53
|
+
<micro_version>0</micro_version>
|
54
|
+
</version>
|
55
|
+
</required_version>
|
56
|
+
</dependency>
|
57
|
+
</dependencies>
|
58
|
+
<files>
|
59
|
+
<file>
|
60
|
+
<filename>uga.rb</filename>
|
61
|
+
<mode>0444</mode>
|
62
|
+
<content encoding="xml">... the file here</content>
|
63
|
+
</file>
|
64
|
+
<file>
|
65
|
+
<filename>booga.h</filename>
|
66
|
+
<mode>0444</mode>
|
67
|
+
<content encoding="xml">... the file here</content>
|
68
|
+
</file>
|
69
|
+
<file>
|
70
|
+
<filename>foo.so</filename>
|
71
|
+
<mode>0555</mode>
|
72
|
+
<!-- Encode routine: str.to_a.pack('m')
|
73
|
+
Decode routine: str.unpack('m') -->
|
74
|
+
<content encoding="mime64">Li4uIHRoZSBmaWxlIGhlcmU=\n</content>
|
75
|
+
</file>
|
76
|
+
</files>
|
77
|
+
</pkg>
|
78
|
+
</rubynet>
|
@@ -0,0 +1 @@
|
|
1
|
+
This is some text to include in an xml file via XInclude.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#
|
2
|
+
# relax ng schema in compact syntax; this cannot be used within libxml but
|
3
|
+
# was used to write the schema as compact syntax makes it easier to handle.
|
4
|
+
# relax ng schema in xml syntax was created using trang.
|
5
|
+
#
|
6
|
+
namespace xsi = "http://www.w3.org/2001/XMLSchema-instance"
|
7
|
+
|
8
|
+
start = shiporder
|
9
|
+
|
10
|
+
shiporder = element shiporder { attribute orderid { text },
|
11
|
+
attribute xsi:noNamespaceSchemaLocation { text },
|
12
|
+
orderperson, shipto, item* }
|
13
|
+
|
14
|
+
orderperson = element orderperson { text }
|
15
|
+
|
16
|
+
shipto = element shipto { name, address, city, country }
|
17
|
+
|
18
|
+
name = element name { text }
|
19
|
+
address = element address { text }
|
20
|
+
city = element city { text }
|
21
|
+
country = element country { text }
|
22
|
+
|
23
|
+
item = element item { title, note?, quantity, price }
|
24
|
+
|
25
|
+
title = element title { text }
|
26
|
+
note = element note { text }
|
27
|
+
quantity = element quantity { text }
|
28
|
+
price = element price { text }
|
@@ -0,0 +1,86 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!--
|
3
|
+
|
4
|
+
relax ng schema in compact syntax; this cannot be used within libxml but
|
5
|
+
was used to write the schema as it's easier to understand
|
6
|
+
|
7
|
+
-->
|
8
|
+
<grammar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://relaxng.org/ns/structure/1.0">
|
9
|
+
<start>
|
10
|
+
<ref name="shiporder"/>
|
11
|
+
</start>
|
12
|
+
<define name="shiporder">
|
13
|
+
<element name="shiporder">
|
14
|
+
<attribute name="orderid"/>
|
15
|
+
<attribute name="xsi:noNamespaceSchemaLocation"/>
|
16
|
+
<ref name="orderperson"/>
|
17
|
+
<ref name="shipto"/>
|
18
|
+
<zeroOrMore>
|
19
|
+
<ref name="item"/>
|
20
|
+
</zeroOrMore>
|
21
|
+
</element>
|
22
|
+
</define>
|
23
|
+
<define name="orderperson">
|
24
|
+
<element name="orderperson">
|
25
|
+
<text/>
|
26
|
+
</element>
|
27
|
+
</define>
|
28
|
+
<define name="shipto">
|
29
|
+
<element name="shipto">
|
30
|
+
<ref name="name"/>
|
31
|
+
<ref name="address"/>
|
32
|
+
<ref name="city"/>
|
33
|
+
<ref name="country"/>
|
34
|
+
</element>
|
35
|
+
</define>
|
36
|
+
<define name="name">
|
37
|
+
<element name="name">
|
38
|
+
<text/>
|
39
|
+
</element>
|
40
|
+
</define>
|
41
|
+
<define name="address">
|
42
|
+
<element name="address">
|
43
|
+
<text/>
|
44
|
+
</element>
|
45
|
+
</define>
|
46
|
+
<define name="city">
|
47
|
+
<element name="city">
|
48
|
+
<text/>
|
49
|
+
</element>
|
50
|
+
</define>
|
51
|
+
<define name="country">
|
52
|
+
<element name="country">
|
53
|
+
<text/>
|
54
|
+
</element>
|
55
|
+
</define>
|
56
|
+
<define name="item">
|
57
|
+
<element name="item">
|
58
|
+
<ref name="title"/>
|
59
|
+
<optional>
|
60
|
+
<ref name="note"/>
|
61
|
+
</optional>
|
62
|
+
<ref name="quantity"/>
|
63
|
+
<ref name="price"/>
|
64
|
+
</element>
|
65
|
+
</define>
|
66
|
+
<define name="title">
|
67
|
+
<element name="title">
|
68
|
+
<text/>
|
69
|
+
</element>
|
70
|
+
</define>
|
71
|
+
<define name="note">
|
72
|
+
<element name="note">
|
73
|
+
<text/>
|
74
|
+
</element>
|
75
|
+
</define>
|
76
|
+
<define name="quantity">
|
77
|
+
<element name="quantity">
|
78
|
+
<text/>
|
79
|
+
</element>
|
80
|
+
</define>
|
81
|
+
<define name="price">
|
82
|
+
<element name="price">
|
83
|
+
<text/>
|
84
|
+
</element>
|
85
|
+
</define>
|
86
|
+
</grammar>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<shiporder orderid="889923"
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
4
|
+
xsi:noNamespaceSchemaLocation="shiporder.xsd">
|
5
|
+
<orderperson>John Smith</orderperson>
|
6
|
+
<shipto>
|
7
|
+
<name>Ola Nordmann</name>
|
8
|
+
<address>Langgt 23</address>
|
9
|
+
<city>4000 Stavanger</city>
|
10
|
+
<country>Norway</country>
|
11
|
+
</shipto>
|
12
|
+
<item>
|
13
|
+
<title>Empire Burlesque</title>
|
14
|
+
<note>Special Edition</note>
|
15
|
+
<quantity>1</quantity>
|
16
|
+
<price>10.90</price>
|
17
|
+
</item>
|
18
|
+
<item>
|
19
|
+
<title>Hide your heart</title>
|
20
|
+
<quantity>1</quantity>
|
21
|
+
<price>9.90</price>
|
22
|
+
</item>
|
23
|
+
</shiporder>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1" ?>
|
2
|
+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
3
|
+
<xs:element name="shiporder">
|
4
|
+
<xs:complexType>
|
5
|
+
<xs:sequence>
|
6
|
+
<xs:element name="orderperson" type="xs:string"/>
|
7
|
+
<xs:element name="shipto">
|
8
|
+
<xs:complexType>
|
9
|
+
<xs:sequence>
|
10
|
+
<xs:element name="name" type="xs:string"/>
|
11
|
+
<xs:element name="address" type="xs:string"/>
|
12
|
+
<xs:element name="city" type="xs:string"/>
|
13
|
+
<xs:element name="country" type="xs:string"/>
|
14
|
+
</xs:sequence>
|
15
|
+
</xs:complexType>
|
16
|
+
</xs:element>
|
17
|
+
<xs:element name="item" maxOccurs="unbounded">
|
18
|
+
<xs:complexType>
|
19
|
+
<xs:sequence>
|
20
|
+
<xs:element name="title" type="xs:string"/>
|
21
|
+
<xs:element name="note" type="xs:string" minOccurs="0"/>
|
22
|
+
<xs:element name="quantity" type="xs:positiveInteger"/>
|
23
|
+
<xs:element name="price" type="xs:decimal"/>
|
24
|
+
</xs:sequence>
|
25
|
+
</xs:complexType>
|
26
|
+
</xs:element>
|
27
|
+
</xs:sequence>
|
28
|
+
<xs:attribute name="orderid" type="xs:string" use="required"/>
|
29
|
+
</xs:complexType>
|
30
|
+
</xs:element>
|
31
|
+
</xs:schema>
|
data/test/model/soap.xml
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<soap:Envelope
|
3
|
+
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
|
4
|
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
5
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
6
|
+
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
|
7
|
+
<soap:Body>
|
8
|
+
<getManufacturerNamesResponse name="widgestRus" xmlns="http://services.somewhere.com">
|
9
|
+
<IDAndNameList xmlns="http://services.somewhere.com">
|
10
|
+
<ns1:IdAndName xmlns:ns1="http://domain.somewhere.com">
|
11
|
+
<id xmlns="http://domain.somewhere.com">1</id>
|
12
|
+
<name xmlns="http://domain.somewhere.com">man1</name>
|
13
|
+
|
14
|
+
</ns1:IdAndName>
|
15
|
+
<ns1:IdAndName xmlns:ns1="http://domain.somewhere.com">
|
16
|
+
<id xmlns="http://domain.somewhere.com">2</id>
|
17
|
+
<name xmlns="http://domain.somewhere.com">man2</name>
|
18
|
+
|
19
|
+
</ns1:IdAndName>
|
20
|
+
<ns1:IdAndName xmlns:ns1="http://domain.somewhere.com">
|
21
|
+
<id xmlns="http://domain.somewhere.com">3</id>
|
22
|
+
<name xmlns="http://domain.somewhere.com">man3</name>
|
23
|
+
</ns1:IdAndName>
|
24
|
+
</IDAndNameList>
|
25
|
+
</getManufacturerNamesResponse>
|
26
|
+
</soap:Body>
|
27
|
+
</soap:Envelope>
|
@@ -0,0 +1,110 @@
|
|
1
|
+
require 'xml'
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
class AttributesTest < Test::Unit::TestCase
|
5
|
+
def setup()
|
6
|
+
xp = XML::Parser.string(<<-EOS)
|
7
|
+
<CityModel
|
8
|
+
xmlns="http://www.opengis.net/examples"
|
9
|
+
xmlns:city="http://www.opengis.net/examples"
|
10
|
+
xmlns:gml="http://www.opengis.net/gml"
|
11
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
12
|
+
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
|
13
|
+
xsi:schemaLocation="http://www.opengis.net/examples city.xsd">
|
14
|
+
<cityMember name="Cambridge"
|
15
|
+
xlink:type="simple"
|
16
|
+
xlink:title="Trinity Lane"
|
17
|
+
xlink:href="http://www.foo.net/cgi-bin/wfs?FeatureID=C10239"
|
18
|
+
gml:remoteSchema="city.xsd#xpointer(//complexType[@name='RoadType'])"/>
|
19
|
+
</CityModel>
|
20
|
+
EOS
|
21
|
+
|
22
|
+
@doc = xp.parse
|
23
|
+
end
|
24
|
+
|
25
|
+
def teardown()
|
26
|
+
@doc = nil
|
27
|
+
end
|
28
|
+
|
29
|
+
def city_member
|
30
|
+
@doc.find('/city:CityModel/city:cityMember').first
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_attributes
|
34
|
+
attributes = city_member.attributes
|
35
|
+
assert_instance_of(XML::Attributes, attributes)
|
36
|
+
assert_equal(5, attributes.length)
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_each
|
40
|
+
attributes = city_member.attributes
|
41
|
+
length = attributes.inject(0) do |result, attr|
|
42
|
+
assert_instance_of(XML::Attr, attr)
|
43
|
+
result + 1
|
44
|
+
end
|
45
|
+
assert_equal(5, length)
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_get_attribute
|
49
|
+
attributes = city_member.attributes
|
50
|
+
|
51
|
+
attr = attributes.get_attribute('name')
|
52
|
+
assert_instance_of(XML::Attr, attr)
|
53
|
+
|
54
|
+
attr = attributes.get_attribute('does_not_exist')
|
55
|
+
assert_nil(attr)
|
56
|
+
|
57
|
+
attr = attributes.get_attribute('name')
|
58
|
+
assert_instance_of(XML::Attr, attr)
|
59
|
+
|
60
|
+
# FIXME Namespaced attribute, without namespace specified
|
61
|
+
# attr = attributes.get_attribute('href')
|
62
|
+
# assert_instance_of(XML::Attr, attr)
|
63
|
+
# assert_instance_of(XML::NS, attr.ns)
|
64
|
+
# assert_equal('xlink', attr.ns.prefix)
|
65
|
+
# assert_equal('http://www.w3.org/1999/xlink', attr.ns.href)
|
66
|
+
|
67
|
+
# FIXME this should be working, wtf happened
|
68
|
+
# attr = attributes.get_attribute_ns('http://www.w3.org/1999/xlink', 'href')
|
69
|
+
# assert_instance_of(XML::Attr, attr)
|
70
|
+
#
|
71
|
+
# attr = attributes.get_attribute_ns('http://www.opengis.net/gml', 'remoteSchema')
|
72
|
+
# assert_instance_of(XML::Attr, attr)
|
73
|
+
#
|
74
|
+
# attr = attributes.get_attribute_ns('http://i.dont.exist', 'nor do i')
|
75
|
+
# assert_nil(attr)
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_get_values
|
79
|
+
assert_equal('Cambridge', city_member[:name])
|
80
|
+
# FIXME Namespaced attribute, without namespace specified
|
81
|
+
# assert_equal('http://www.foo.net/cgi-bin/wfs?FeatureID=C10239', city_member[:href])
|
82
|
+
|
83
|
+
attributes = city_member.attributes
|
84
|
+
assert_equal('Cambridge', attributes[:name])
|
85
|
+
# FIXME Namespaced attribute, without namespace specified
|
86
|
+
# assert_equal('http://www.foo.net/cgi-bin/wfs?FeatureID=C10239', attributes[:href])
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_set_values
|
90
|
+
city_member[:name] = 'London'
|
91
|
+
assert_equal('London', city_member[:name])
|
92
|
+
|
93
|
+
city_member[:href] = 'foo'
|
94
|
+
assert_equal('foo', city_member[:href])
|
95
|
+
|
96
|
+
attributes = city_member.attributes
|
97
|
+
|
98
|
+
attributes[:name] = 'London'
|
99
|
+
assert_equal('London', attributes[:name])
|
100
|
+
|
101
|
+
attributes[:href] = 'foo'
|
102
|
+
assert_equal('foo', attributes[:href])
|
103
|
+
end
|
104
|
+
|
105
|
+
def test_str_sym()
|
106
|
+
attributes = city_member.attributes
|
107
|
+
assert_equal('Cambridge', attributes[:name])
|
108
|
+
assert_equal('Cambridge', attributes['name'])
|
109
|
+
end
|
110
|
+
end
|