xmlcodec 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/stream_object_parser.rb +1 -1
- data/lib/stream_parser.rb +5 -4
- metadata +2 -2
data/Rakefile
CHANGED
data/lib/stream_object_parser.rb
CHANGED
@@ -4,7 +4,7 @@ module XMLCodec
|
|
4
4
|
# This class is used internally by the parser to store the information about
|
5
5
|
# each of the elements that gets created.
|
6
6
|
class XMLSOParserElement
|
7
|
-
attr_reader :elclass, :consumed, :id, :depth
|
7
|
+
attr_reader :elclass, :consumed, :id, :depth, :parent, :name
|
8
8
|
|
9
9
|
# Create a new instance with the element name, a hash of atributes, it's
|
10
10
|
# import/export class, the parent element and it's id
|
data/lib/stream_parser.rb
CHANGED
@@ -30,15 +30,16 @@ module XMLUtils
|
|
30
30
|
class XMLSParserElement
|
31
31
|
attr_reader :name
|
32
32
|
attr_reader :element_id
|
33
|
-
attr_reader :parent_id
|
33
|
+
attr_reader :parent_id, :parent
|
34
34
|
attr_reader :elstart
|
35
35
|
|
36
|
-
def initialize(name, elstart, parser,
|
36
|
+
def initialize(name, elstart, parser, parent)
|
37
37
|
@name = name
|
38
38
|
@parser = parser
|
39
39
|
@elstart = elstart
|
40
40
|
@element_id = parser.new_element_id
|
41
|
-
@
|
41
|
+
@parent = parent
|
42
|
+
@parent_id = parent.element_id if parent
|
42
43
|
end
|
43
44
|
|
44
45
|
def self.root(parser)
|
@@ -76,7 +77,7 @@ module XMLUtils
|
|
76
77
|
|
77
78
|
def tag_start(name, attrs)
|
78
79
|
@elements << XMLSParserElement.new(name, @contents.size,
|
79
|
-
self, @elements[-1]
|
80
|
+
self, @elements[-1])
|
80
81
|
@contents << XMLUtils.create_open_tag(name, attrs)
|
81
82
|
end
|
82
83
|
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: xmlcodec
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
7
|
-
date: 2006-
|
6
|
+
version: 0.1.1
|
7
|
+
date: 2006-09-12 00:00:00 +01:00
|
8
8
|
summary: Generic Importer/Exporter of XML formats
|
9
9
|
require_paths:
|
10
10
|
- lib
|