File tree Expand file tree Collapse file tree
main/clojure/clojure/data/xml
test/clojure/clojure/data/xml Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6565 hence enabling usage of .cljc while supporting clojure < 1.7.0 -->
6666 <groupId >net.bendlas</groupId >
6767 <artifactId >cljc-maven-plugin</artifactId >
68- <version >0.1.1 </version >
68+ <version >0.1.2 </version >
6969 <executions >
7070 <execution >
71+ <id >split-compile</id >
7172 <phase >generate-sources</phase >
7273 <goals ><goal >split</goal ></goals >
7374 </execution >
75+ <execution >
76+ <id >split-compile-tests</id >
77+ <phase >generate-test-sources</phase >
78+ <goals ><goal >split-tests</goal ></goals >
79+ </execution >
7480 </executions >
7581 </plugin >
7682 <plugin >
Original file line number Diff line number Diff line change 1212 (:require [clojure.data.xml.name :refer [as-qname]])
1313 #? (:clj (:import (clojure.lang IHashEq IObj ILookup IKeywordLookup Counted
1414 Associative Seqable IPersistentMap
15- APersistentMap RecordIterator RT
16- MapEquivalence)
15+ APersistentMap RT MapEquivalence MapEntry)
1716 (java.io Serializable Writer)
18- (java.util Map))))
17+ (java.util Map Iterator ))))
1918
2019; ; Parsed data format
2120; ; Represents a node of an XML tree
3029
3130; ; FIXME hash caching cannot be used: http://dev.clojure.org/jira/browse/CLJ-2092
3231
32+ #?
33+ (:clj
34+ (deftype ElementIterator [el ^:volatile-mutable fields]
35+ Iterator
36+ (hasNext [_] (boolean (seq fields)))
37+ (next [_]
38+ (let [f (first fields)]
39+ (set! fields (next fields))
40+ (MapEntry. f (get el f))))))
41+
3342(deftype Element [tag attrs content meta]
3443
3544 ; ; serializing/cloning, hashing, equality, iteration
4150 IHashEq
4251 (hasheq [this] (APersistentMap/mapHasheq this))
4352 Iterable
44- (iterator [this] (RecordIterator . this [ :tag :attrs :content ] ( RT/iter nil )))]
53+ (iterator [this] (ElementIterator . this '( :tag :attrs :content )))]
4554 :cljs
4655 [ICloneable
4756 (-clone [_] (Element. tag attrs content meta))
Original file line number Diff line number Diff line change 88 (element :foo ) {:tag :foo :attrs {} :content []}
99 (element (qname " DAV:" " foo" )) {:tag (qname " DAV:" " foo" ) :attrs {} :content []}
1010 (element :foo {:a " b" }) {:tag :foo :attrs {:a " b" } :content []}
11- (element :foo {:a " b" } " a" " b" ) {:tag :foo :attrs {:a " b" } :content [" a" " b" ]}
12- #?@(:clj ; ; wait for https://github.com/clojure/clojurescript/commit/9484a134bdf039c10ec3c26c8aaa3acd0dcd9875
13- [#xml/element {:tag :foo :content [" C" ]} {:tag :foo :attrs {} :content [" C" ]}])))
11+ (element :foo {:a " b" } " a" " b" ) {:tag :foo :attrs {:a " b" } :content [" a" " b" ]}))
You can’t perform that action at this time.
0 commit comments