Its an enum and we want ProfileToggleType to be an enum. In our XSD the enum
value is Sync_Test but when doing unmarshalling it is comming as SYNC_TEST.
But we want it to come as Sync_Test.
On Tue, May 18, 2010 at 3:36 PM, Wolfgang Laun <wolfgang.laun_at_gmail.com>wrote:
> What are the Java types of SYNC_TEST, profile, and
> ProfileConstants.SYNCTEST_PROFILE?
> Which should map to the schema type ProfileToggleType?
>
> Do you want ProfileToggleType to be an enum? Or do you want this type
> to be java.lang.String?
> And the same for all other schema types defined according to
> <xs:restriction base="xs:string"><xs:enumeration ...>?
>
> -W
>
>
> On Tue, May 18, 2010 at 10:59 AM, Rochak Gupta <rochak005_at_gmail.com>
> wrote:
> >
> > HI,
> >
> >
> >
> > While updgrading JAXB1.x to JAXB2.1.10 migration , there is a problem
> lies in the enumeration . I am pasting the snapshot of xsd which is catching
> problem
> >
> >
> >
> > <xs:simpleType name="ProfileToggleType">
> >
> > <xs:restriction base="xs:string">
> >
> > <xs:enumeration value="SubscriptionProfile" />
> >
> > <xs:enumeration value="Sync_Test" />
> >
> > </xs:restriction>
> >
> > </xs:simpleType>
> >
> >
> >
> > When we do unmarshal a request
> >
> >
> >
> > com.att.osd.bbnms.bbcats.xml.synctest.schema.SyncTestRequest req =
> >
> >
> (com.att.osd.bbnms.bbcats.xml.synctest.schema.SyncTestRequest) unmarshaller
> >
> > .unmarshal(request);
> >
> >
> >
> > When we get the respective value from the unmarshalled req object and do
> subsequent processing as given below
> >
> >
> >
> > if (SYNC_TEST.equals(profile))
> >
> > {
> >
> > profile = ProfileConstants.SYNCTEST_PROFILE;
> >
> > }
> >
> >
> >
> > The comparison is failing because we expect as per to xsd “Sync_Test”
> however we are getting “SYNC_TEST” . In JAXB1 we were getting as defined in
> xsd i.e. “Sync_Test”
> >
> >
> >
> > So is there any way through some external binding we can stop jaxb
> marshaller/unmarshaller to convert everything to bold and have exactly as
> there in xsd .
> >
> > Thanks and regards,
> > Rochak Gupta
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>