| Issue 48: | The local namespace (xmlns="") is not considered | |
| 1 person starred this issue and may be notified of changes. | Back to list |
* What steps will reproduce the problem?
1. Create an object like the following configuration:
[Namespace(prefix="mgm", uri="http://www.mgm.com/app")]
[XmlClass(alias="Response", prefix="mgm")]
public class Response {
public function Response() {
}
[XmlElement(alias="id", namespace="mgm")]
public var id:String;
[XmlArray(alias="fields", namespace = "")]
public var fields:ArrayCollection;
}
}
2. Deserialize an instanciation of this object and get this data:
<mgm:Response xmlns:mgm="http://www.mgm.com/app">
<mgm:fields>
one
two
three
</mgm:fields>
<mgm:id>prodhost</mgm:id>
</mgm:Response>
* What is the expected output? What do you see instead?
<mgm:Response xmlns:mgm="http://www.mgm.com/app">
<fields>
one
two
three
</fields>
<mgm:id>prodhost</mgm:id>
</mgm:Response>
I would like the 'fields' element to have an empty namespace. I don't control the XML format and some fields have a qualified namespace while others have the empty one. This is a mess from the XML specification that W3C chose in order to be backward compatible with version 1.0, which had no namespace. The empty (or rather local) namespace is different from a URI'ed one. More explanation is provided in this link:
http://www.jclark.com/xml/xmlns.htm.
* What version of the product are you using? On what operating system?
flexxb 2.1
Flash 10.2
Windows XP :(
* Please provide any additional information below.
flexxb does not seem to handle the local namespace. To do so, it requires to treat it as a special case. I haven't found anything that suggest it does right now. Can you provide the proper way to do it if any? Or a workaround while we wait for a fix? :)
Regards,
Jimmy
Jun 21, 2011
Project Member
#1
alex.id....@gmail.com
Status:
Accepted
Jun 22, 2011
Hmmm... you're right. THis should be a feature setting the namespace to "". I'll work on it. In the meantime you can leverage the namespaces to get a workaround. 1. Remove prefix="mgm" attribute from XmlClass. 2. In the class that uses a Response field add the mgm namespace metadata 3. Set the namespace on the Response field metadata to mgm. This should get you the same behavior until I release the fix for it. Let me know how it works, Alex
Labels:
Milestone-2.2.0
Jun 27, 2011
(No comment was entered for this change.)
Status:
Fixed
Jun 27, 2011
Now you can set the namespace ref to "" and use the local namespace
Jul 7, 2011
Thanks a lot Alex, I grabbed the latest and it works as expected!
Jul 7, 2011
(No comment was entered for this change.)
Status:
Verified
|