<< Back to previous view

[DZIP-3] Not returning expected result for 'tag=' Created: 17/Apr/14  Updated: 02/Nov/15

Status: Open
Project: data.zip
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Frank Castellucci Assignee: Alex Miller
Resolution: Unresolved Votes: 0
Labels: None

:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/data.zip "0.1.1"]]



(require '[clojure.xml :as xml])
(require '[clojure.zip :as zip])
(require '[clojure.data.zip.xml :as dzx])

(def s "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<result>\n <status>success</status>\n <message>success</message>\n <format>xml</format>\n <language>en</language>\n <ip></ip>\n <country_code>US</country_code>\n <country>United States</country>\n <region>California</region>\n <city>San Francisco</city>\n <latitude>37.7757</latitude>\n <longitude>-122.3952</longitude>\n <zip_code>94107</zip_code>\n <timezone>-08:00</timezone>\n <localtime>2014-04-17 06:52:45</localtime>\n</result>\n")

(def x (xml/parse (org.xml.sax.InputSource. (java.io.StringReader. s))))
(def z (zip/xml-zip x))

Works as expected:

(dzx/xml1-> z :ip dzx/text)
;; ""

(dzx/xml1-> z :status dzx/text)
;; "success"

Doesn't seem to work as expected:

(dzx/xml1-> z :result)
;; nil   (expected something not nil)

(dzx/xml1-> z :result :status dzx/text)
;; nil   (expected "success")

Generated at Tue Nov 24 22:13:51 CST 2015 using JIRA 4.4#649-r158309.