Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attributes get lowercased; xmlns omitted #8

Open
nchurch opened this issue Oct 22, 2012 · 2 comments
Open

Attributes get lowercased; xmlns omitted #8

nchurch opened this issue Oct 22, 2012 · 2 comments

Comments

@nchurch
Copy link

nchurch commented Oct 22, 2012

I tried parsing some Android XML configuration files; these have attributes, for instance, like

android:keyWidth="15%p"
android:horizontalGap="0px"
android:verticalGap="0px"

clj-tagsoup lowercases the attribute names-----e.g.:

android:keywidth

so that it doesn't roundtrip through Hiccup.

Additionally, it doesn't pick up the xmlns declaration in the root element; e.g:

xmlns:android="http://schemas.android.com/apk/res/android"

This has to be put back in by hand.

(I'm using Android as an example, but presumably these issues have relevance beyond Android.)

Thanks,

Nick.

@kurt-o-sys
Copy link

+1

Same issue with svg parsing: viewBox is changed to viewbox, which is not valid for svg, giving an error.
Could lowercasing be optional?

@dimovich
Copy link

dimovich commented Feb 6, 2019

You could fix the lowercase :viewbox like this:

(-> (pl.danieljanus.tagsoup/parse-string svg-string)
    (update 1 clojure.set/rename-keys {:viewbox :viewBox}))

I wonder @nathell, is the lowercasing done in clj-tagsoup or in some underlying library?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants