Created
February 6, 2013 03:44
-
-
Save boxxxie/4720053 to your computer and use it in GitHub Desktop.
how would i eliminate the duplicate xml traversals by reusing common zipper locations?
tried saving (xml-> parsed-page :Items :Item :Facets :Facet) and reusing that in the sub-categories traversal, but got errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let [parsed-page (cxml/parse-string (emit-cxml-from-pages | |
[page1-mock] | |
"IMGBASE-STRING" | |
"whatever name")) | |
header-cat-names (xml-> parsed-page :FacetCategories :FacetCategory (attr :Name)) | |
categories (set (xml-> parsed-page :Items :Item :Facets :Facet (attr :Name))) | |
sub-categories (set (xml-> parsed-page :Items :Item :Facets :Facet :String (attr :Value))) | |
collection-attrs #spy/d(->> t first :attrs keys set) | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment