eerohele / eerohele/sigel

hiccup-style input

Open
#6 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Clojure
Stars
31
Forks
3
PR merge metrics
No merged PRs in 30d

Description

I frequently find myself utilizing hiccup-style data structures rather than strings/streams. Something like:
```
[:list
[:token "defproject"]
[:whitespace " "]...
]
```
In the past, I would convert it into a string and then perform my XSLT transformations. However, more recently, I crafted a straightforward wrapper around TinyBuilder.
```
(defn xml-document [tree]
(let [processor (Processor. false)
configuration (.getUnderlyingConfiguration processor)
builder (TinyBuilder. (.makePipelineConfiguration configuration))
walk (fn walk [x]
(if (coll? x)
(do
(.startElement builder (FingerprintedQName. "" "" (name (first x))) (Untyped/getInstance) ExplicitLocation/UNKNOWN_LOCATION 0)
(run! walk (rest x))
(.endElement builder))
(.characters builder x ExplicitLocation/UNKNOWN_LOCATION 0)))]
(.open builder)
(.startDocument builder 0)
(walk tree)
(.close builder)
(.getRootNode (.getTree builder))))
```

At present, it does not have the capability to handle attributes.
Would you be interested in incorporating this code into your library once it is completed?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the issue's xml-document wrapper and its use of TinyBuilder, then inspect the library's existing input and transformation entry points. Done means the wrapper or library can accept hiccup-style trees including attributes and use them for XSLT transformations, with the integration approach confirmed by the project.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.