<< Back to previous view

[DXML-4] Namespaces support Created: 27/Mar/12  Updated: 13/Jan/16  Resolved: 13/Jan/16

Status: Closed
Project: data.xml
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Carlo Sciolla Assignee: Ryan Senior
Resolution: Completed Votes: 12
Labels: None

Attachments: Text File add_namespaces.patch     Text File add-namespace-support.patch     Text File roundtrip-documents.patch    
Patch: Code and Test


Add support for both parsing and emitting namespace qualified tags and namespaces URI declarations.
It basically follows the underlying Java XML API in giving xmlns:foo attributes "special" treatment.

Comment by Ryan Senior [ 22/May/12 10:26 AM ]

I don't see a contributor agreement for you Carlo. Have you signed one? http://clojure.org/contributing

Comment by Gary Trakhman [ 19/Jun/12 6:09 PM ]

ping, is the patch still waiting for a signed CA?

Comment by Ryan Senior [ 26/Jun/12 12:14 PM ]


Comment by Robert Onslow [ 01/Dec/12 5:07 AM ]

Is this patch due reasonable soon?

Comment by Andy Fingerhut [ 21/Apr/13 7:04 PM ]

Link to a design page with some ideas for XML namespace support in Clojure: http://dev.clojure.org/display/DXML/Fuller+XML+support

Comment by Herwig Hochleitner [ 26/Mar/14 9:20 AM ]

I've taken another stab at this. Attached roundtrip-documents.patch implements roundtripping, which means reading and writing xmlns attributes and namespaces as is.

Further improvements, that would fall into the scope of this ticket, but should be implemented on top of correct roundtripping, hence another ticket might be in order:

  • functionality for normalizing prefixes
  • rewriting prefixes
  • finding a minimal set of prefix names and/or default namespace, for given fragment
Comment by Steve Suehs [ 26/Mar/14 4:04 PM ]

I could really use this. I'm tweaking poms and the xml headers with schema locations cause grief. If you are in Austin I'll buy you a beer.

Comment by Herwig Hochleitner [ 01/Apr/14 4:41 AM ]

Good to hear that. I've implemented a walker to resolve names in namespaced xml and have the emitter assign the prefix of a resolved name. You can review / use at your own peril from here: https://github.com/bendlas/data.xml

Right now, I'm doing cleanup passes and trying to get feedback from the before pushing for change.

Comment by Paul Gearon [ 21/May/14 12:53 AM ]

I stupidly did this myself before realizing it was already done.
What is the current status? Still waiting on Carlo (since he's submitted a patch), looking to use Herwig's, or something else?

I wasn't totally happy with how I did it, since I used a binding for a parallel stack containing the current prefix->URI mappings. This was because QName prefixes are kept in the namespace of an element's keyword, but .writeStartElement and .writeAttribute need the URIs the prefix maps to, which wasn't being kept. It'd be nice to see if there's a better way.

Comment by Paul Gearon [ 21/May/14 10:36 AM ]

Submitting this patch, since the process requires a patch file. Carlo has not responded about the contributor agreement for 2 years, and none of the other attempts have been submitted as patches (edit: I've now seen Herwig's emails and realize that this is active).

Other implementations may be better, but I need to get the ball rolling on this.

Comment by Martin Clausen [ 27/Aug/14 2:35 PM ]

Carlo has signed a CA and is on the contributor list. Hope this means this much needed patch can be accpeted.

Comment by Thomas Engelschmidt [ 01/Nov/14 8:48 AM ]

Are there any plans on applying the patches ?

Comment by Ryan Senior [ 03/Nov/14 6:42 AM ]

We will be merging in Herwig's implementation soon. We're still waiting on getting him commit rights to the data.xml repo, so for now you can find his implementation here: https://github.com/bendlas/data.xml. We're planning on merging that into a namespaces branch where we'll hopefully have a beta release soon.

Comment by Christian Weilbach [ 25/May/15 8:37 AM ]

Any updates? This would probably resolve my problem as well: http://dev.clojure.org/jira/browse/DXML-23.

Comment by Joshua Griffith [ 16/Sep/15 10:41 AM ]

We ran into this problem when integrating with an external XML service. Are there any remaining barriers to this landing?

Comment by Ryan Senior [ 16/Sep/15 10:49 AM ]

Herwig is currently working on this in a fork (https://github.com/bendlas/data.xml), AFAIK his intention is to add it to data.xml once it's done

Comment by Joshua Griffith [ 12/Jan/16 7:53 PM ]

Is this closed? https://github.com/clojure/data.xml/commit/31558df7826fd388255bfe4c3b77ad4fbd8b89d1 suggests that it is.

Comment by Ryan Senior [ 13/Jan/16 8:43 AM ]

Correct, this was released as part of 0.1.0-beta1. Would love some feedback if you're using it.

Comment by Ryan Senior [ 13/Jan/16 8:43 AM ]

Released as 0.1.0-beta1

Generated at Sun Jan 21 07:05:42 CST 2018 using JIRA 4.4#649-r158309.