(def testxml2
"<top>
<group>
<group>
<item>
<number>1</number>
</item>
<item>
<number>2</number>
</item>
<item>
<number>3</number>
</item>
</group>
<item>
<number>0</number>
</item>
</group>
</top>")
(def txml2 (zip-str testxml2))
(defn deep-items [x]
(zip-xml/xml-> x
:top
:group
:group
:item))
(count (deep-items txml2))
;; 1
(zip-xml/text (first (deep-items txml2)))
;; "0"
I'm trying to get the value of the inner :group, but it seems to be getting caught on the outside one. It seems to be ignoring the second :group.
The actual XML I'm trying to parse has a repeated nested <TheirTag><TheirTag>Foo</TheirTag></TheirTag> pattern going on and I need to access each Foo individually. The XML is from a third party so I can't just restructure the XML to avoid this.
The reason for the bug is here. For the short version: version 0.1.2 is slightly broken in this respect, that a sub-entry with the same name cannot be selected via the
tag=function (which underlies the:myTagstyle selectors. This is due to a regression from 0.1.1 to 0.1.2 (thanks @bpeter and @shilder). The workaround is to make a functiontag=in some util namespace and use it directly until the regression is fixed.