<< Back to previous view

[DXML-4] Namespaces support Created: 27/Mar/12  Updated: 27/Aug/14

Status: Open
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: Unresolved Votes: 6
Labels: None

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

 Description   

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.



 Comments   
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 ]

Yes

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.

Generated at Wed Oct 22 01:32:16 CDT 2014 using JIRA 4.4#649-r158309.