Community
Participate
Working Groups
Created attachment 221444 [details] Simple patch XMLField.buildFragments splits @XmlPath values at slashes, even when they are found within string values. Consider the following annotation on a property: @XmlPath("atom:category[@scheme='http://example/scheme']/@term") This is a very common pattern for us given that the RESTful API we are communicating with is mostly atom based and its documentation is XPath centric. Parsing will always give a null value whereas generation will give us this disappointing output: <?xml version="1.0" encoding="UTF-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom"> <atom:category[@scheme='http:> <example> <scheme'] term="test"/> </example> </atom:category[@scheme='http:> </atom:entry> I'm attaching a simplistic patch which fixes the problem for any but the trickiest exceptions and should have no adverse effects. Parsing works and we get the following output generated: <?xml version="1.0" encoding="UTF-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom"> <atom:category scheme="http:/example/scheme" term="test"/> </atom:entry>
Upon closer inspection, it appears that double slashes (as in http://) are turned into single slashes (http:/) with my patch. I expect this to be an easy fix using returnDelims of StringTokenizer.
Created attachment 221468 [details] Simple patch v2 Updated patch to handle double slashes.
Attached patch has been reviewed, verified and committed. A junit test case was also added for this use case. The fix was checked into master and 2.4 branches and will appear in future nightly builds of those streams.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink