Declined
Details
Assignee
Ryan SeniorRyan SeniorReporter
importimportPriority
Major
Details
Details
Assignee
Ryan Senior
Ryan SeniorReporter
import
importPriority

Created September 1, 2016 at 7:11 PM
Updated October 3, 2016 at 11:49 PM
Resolved October 3, 2016 at 11:49 PM
There is an issue occurring somewhere in the chain of:
```
(require '[clojure.data.xml :as xml])
(-> "<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo xml:lang=\"en\"></foo>" xml/parse-str pprint)
```
Which results in the following error:
```
XMLStreamException Prefix cannot be null com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeAttribute (XMLStreamWriterImpl.java:575)
```
It appears, after some brief exploration, that this comes from emitting the string which is parsed into a keyword with a namespace. The following results show this:
```
user=> (-> "<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo xml:lang=\"en\"></foo>" xml/parse-str pprint)
{:tag :foo, :attrs {:xml/lang "en"}, :content ()}
```
and
```
user=> (xml/emit-str (xml/element :foo {:xml:lang "en"}))
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo xml:lang=\"en\"></foo>"
```