-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
It looks like the changes made to the processAttributesAndNamespaces(Node n, JSONObject object) method in the MappedNamespaceConvention.java source back in the 2.0 release, no longer processes no prefix attributes correctly. In the 1.0 release, the following JSON:
{ "toy": { "@xmlns": "http://examples.com" }}
Produced the following XML, when converted:
<toy xmlns="http://examples.com"/>
It no longer does that, starting with the 2.0 release. One possible fix is to add:
if (o instanceof String) {
String uri = o.toString();
QName name = new QName( XMLConstants.DEFAULT_NS_PREFIX, k );
n.setAttribute(name, uri);
}
after the following if statement:
if ( o instanceof JSONObject ) {
JSONObject jo = (JSONObject) o;
for (Iterator<?> pitr = jo.keys(); pitr.hasNext();) {
// set namespace if one is specified on this attribute.
String prefix = (String) pitr.next();
String uri = jo.getString( prefix );
// if ( prefix.equals( "$" ) ) {
// prefix = "";
// }
n.setNamespace( prefix, uri );
}
}
Metadata
Metadata
Assignees
Labels
No labels