I generated a binding file using the xsd2jibx.jar and my schema. I modified
the generated schema so that the fields in the binding file matched the
variable names in the Java classes and so the classes in the binding file
pointed to my classes.
I have an element in my XML called JournalEntryVersion and it is in the sje
name space which is http://www.myURL.com/file/path/journalentry but
accourding to the schema it is supposed to be <JournalEntryVersion> instead
of <sje:JournalEntryVersion>. I have this same issue repeated for other
elements throughout the XML document.
When I send the XML string to jibx to be unmarshalled with
<JournalEntryVersion>, jibx returns the error
-----------------------------------------
org.jibx.runtime.JiBXException: Expected
"{http://www.myURL.com/file/path/journalentry}JournalEntryVersion" start
tag, found "JournalEntryVersion" start tag (line 1, col 868)
-----------------------------------------
And when I send the XML string to jibx with <sje:JournalEntryVersion> it
goes through jibx just fine but then the validator that checks it against
the schema throughs out an error
-----------------------------------------
Schema Validation Error: cvc-complex-type.2.4.a: Invalid content was found
starting with element 'sje:JournalEntryVersion'. One of
'{"":JournalEntryVersion}' is expected.
Line Number: 1
Column: 873
-----------------------------------------
So to pass schema validation it must be <JournalEntryVersion>. Is there
something I need to add to the binding file to tell jibx to not expect the
sje: part?
My binding file for this element looks like
-----------------------------------------
<binding>
<mapping name="JournalEntry"
class="my.packages.journalentry.model.JournalEntry">
<namespace uri="http://www.myURL.com/file/path/journalentry"
default="elements"/>
<value name="JournalEntryVersion" create-type="JournalEntryVersion"
field="version"/>
<structure field="person" usage="required"
map-as="my.packages.journalentry.model.Person"/>
</mapping>
-----------------------------------------
Any help would be greatly appreciated.
Thank You
Greg Stout
Application Developer I
Kansas Department of Corrections
785-296-7791
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users