Marc Boorshtein wrote:
> 1. If this is valid schema, why won't JAXB accept it?
Because you need to resolve naming conflicts that the JAXB can't resolve
automatically. The JAXB 1.0 Expert Group decided that JAXB should avoid
mangling the generated names as much as possible and opted to require
users to provide a customization to resolve this kind of conflict.
More below...
> 2. I did as there error instructed and changed the [-] to \-, and am
> still getting the following errors:
>
> parsing a schema...
> [ERROR] A class/interface with the same name
> "org.oasis.dsmlv2.BatchResponse" is already in use. Use a class
> customization to resolve this conflict.
> line 73 of dsmlv2.xsd
>
> [ERROR] (Relevant to above error) another "BatchResponse" is generated
> from here.
> line 39 of dsmlv2.xsd
>
> [ERROR] A class/interface with the same name
> "org.oasis.dsmlv2.BatchRequest" is already in use. Use a class
> customization to resolve this conflict.
> line 41 of dsmlv2.xsd
>
> [ERROR] (Relevant to above error) another "BatchRequest" is generated
> from here.
> line 38 of dsmlv2.xsd
>
> Failed to parse a schema.
>
> Just as a comparison, XMLBeans WAS able to compile this schema
> correctly, and it is a "standard" schema supported by sun,novell,ibm &
> microsoft. What is "class customization"?
>
You can take a look at the JAXB spec[1] or the JWSDP Tutorial[2] or you can
look through the sample apps bundled with JAXB[3].
> Granted, the DSMLv2 schema is really complex (why I am using it to look
> at the different XML binding apis). I see that I can do some
> customization in the binding, but I can't find any docs on how to do
> that customization. Any suggestions would be greatly appreciated.
>
In your particular case, I think you have two options:
1. Add a <jxb:class name="SomeNewName"> on each of the declarations causing
the errors above.
2. Add a global binding that adds a suffix to your element names
<jxb:schemaBindings>
<jxb:nameXmlTransform>
<jxb:elementName suffix="Element"/>
</jxb:nameXmlTransform>
</jxb:schemaBindings>
Thanks,
--Ryan
[1]
http://java.sun.com/xml/downloads/jaxb.html (Section 6.7)
[2]
http://java.sun.com/webservices/docs/1.4/tutorial/doc/index.html
(Chapter 2 "Customizing JAXB Bindings - Fix Collides Sample)
[3] $JAXB_HOME/samples
> Thanks!
>
>
>
> ------------------------------------------------------------------------
> --------------------------
> Marc Boorshtein
> Sr. Software Engineer, Octet String
> marc.boorshtein_at_octetstring.com
>
> On Aug 24, 2004, at 10:16 AM, dev_at_samizdatdigital.org wrote:
>
>> that seems to make sense, as "-" is not a character class, and to
>> include it as a character in a character class, you have to escape
>> it, ie [\-] (the error message says asmuch, i believe):
>>
>> [ERROR] Simple type error: specified pattern is invalid: '-' is
>> an invalid character range. Write '\-'.
>> line 115 of dsmlv2.xsd
>>
>> i don't know about all the other errors you're getting, but if i
>> change that line and run xjc, i don't get the regex error (i'm using
>> 1.4 on a mac, jvm 1.4.2).
>>
>> jon
>>
>> On Aug 23, 2004, at 8:08 PM, Marc Boorshtein wrote:
>>
>>> <dsmlv2.xsd>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net