Jaxb - XML scheme validation and External API classes..

M

marco

Hi all,
I have my own XML scheme, (namely, MyScheme.xsd), where various
simpleTypes and complexTypes are listed.

I want to arrange my scheme with the insertion of a element of type
"identifier", that is a class returned by an external API.

Something similar to:

<xsd:complexType name="MyComplexType">
<xsd:sequence>
<xsd:element name="Value" type="xsd:string">
<xsd:element name="Id" type="extAPI.identifier">
</xsd:sequence>
</xsd:complexType>

How can it be done?

If not, is it possible to modify the generated classes after the
validation and the binding of the scheme?
 
T

Tim Hallwyl

Hello Marco!
I want to arrange my scheme with the insertion of a element of type
"identifier", that is a class returned by an external API.
I'm not quite sure what you mean be this. Do you have code already
generated by JAXB, based on a schema that you wish to change now?

If you can be more specific I'd be glad to help.
If not, is it possible to modify the generated classes after the
validation and the binding of the scheme?

You can do some modification, like changing the class name. But watch
out for the annotations!!

--tim
 
M

marco

Thank you, but I solved my problem setting some constraints to the
xsd:string type of the scheme.

The fact was that the class I wanted to insert in the scheme has a
field that can be seen as a 40 bit hex string, and thus I set this
constraint into my scheme, as:

<xsd:simpleType name="extClassId">
<xsd:restriction base="xsd:string">
<xsd:length value="40" />
</xsd:restriction>
</xsd:simpleType>

Marco

Tim Hallwyl ha scritto:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top