xml_to_json 0.0.0 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
@@ -18,4 +18,14 @@ describe "XmlToJson" do
18
18
  it "should transform an array of items into a hash of items" do
19
19
  XmlToJson.transform(@xml).should == {:items => @source}.to_json
20
20
  end
21
+
22
+ it "should transform an empty array of items into an empty hash of items" do
23
+ xml = <<-XML
24
+ <?xml version="1.0" encoding="UTF-8"?>
25
+ <items type="array">
26
+ </items>
27
+ XML
28
+
29
+ XmlToJson.transform(xml).should == {:items => nil}.to_json
30
+ end
21
31
  end
@@ -135,6 +135,7 @@
135
135
 
136
136
  <!-- item:null -->
137
137
  <xsl:template match="*[count(child::node())=0]">
138
+ <xsl:if test="not(preceding-sibling::*)">{</xsl:if>
138
139
  <xsl:call-template name="escape-string">
139
140
  <xsl:with-param name="s" select="local-name()"/>
140
141
  </xsl:call-template>
data/xml_to_json.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{xml_to_json}
8
- s.version = "0.0.0"
8
+ s.version = "0.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matt Todd"]
12
- s.date = %q{2010-11-13}
12
+ s.date = %q{2010-11-29}
13
13
  s.description = %q{Transforms a string of XML into a string of JSON}
14
14
  s.email = %q{chiology@gmail.com}
15
15
  s.files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xml_to_json
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 0
10
- version: 0.0.0
9
+ - 1
10
+ version: 0.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Todd
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-13 00:00:00 -05:00
18
+ date: 2010-11-29 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency