Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

Jaxb - XML scheme validation and External API classes..

Thread view: 
marco - 14 Sep 2006 15:05 GMT
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?
Tim Hallwyl - 26 Sep 2006 17:23 GMT
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
marco - 29 Sep 2006 13:58 GMT
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:

> Hello Marco!
>
[quoted text clipped - 12 lines]
>
> --tim


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.