Hi
While processing an IETF XML schema I encountered a problem with the
marshaling of a simpleType base on string.
I tryed to reduced the problem to a smaller XML schema to make things
easier to understand (let me know if you prefer the IETF references):
[...]
<element name="ruleset">
<complexType>
<sequence>
<element name="rule"
type="tns:extensibleType"></element>
</sequence>
</complexType>
</element>
<xs:complexType name="extensibleType">
<xs:sequence>
<xs:any namespace="##other" minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<element name="allow-invite" type="tns:AllowInviteType"></element>
<simpleType name="AllowInviteType">
<restriction base="string">
<enumeration value="accept"></enumeration>
<enumeration value="reject"></enumeration>
</restriction>
</simpleType>
[...]
I construct a document with the following java code:
Ruleset ruleset = new Ruleset();
Rule rule = new Rule();
ruleset.setRule(rule);
rule.addAnyObject(AllowInviteType.ACCEPT);
And marshal ruleset it produces the following:
<?xml version="1.0" encoding="UTF-8"?>
<ruleset xmlns="http://www.example.org/test2">
<rule>
<AllowInviteType
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="AllowInviteType"/>
</rule>
</ruleset>
In fact I've seen two problems:
a) it should rather generate the value of the AllowInvite instead such as:
<AllowInviteType>ACCEPT</AllowInviteType>,
b) I expect to see '<AllowInvite>' and not '<AllowInviteType>'. This
is related to issue 1990 I reported previously.
Regards
Pascal
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email