Skip to main content

mapping file - need more details on how to use patterns for renaming.

2 replies [Last post]
Joined: 2005-03-28
Points: 0

I have a schema which uses a set of inherited attributes
on all the classes
it looks something like this:

VRA Core metadata attributes which can be applied to virtually any

then element definitions like this:

(lots of these)

there are several elements that share the id,source, and vocab attribute, and some others that add another attribute or two to the standard set, and then use
that type as their type.
So, anyway, I get this error from the build:
C:\Program Files\Java\tomcat50-jwsdp\jaxb\samples\vra>ant
Buildfile: build.xml

[echo] Compiling the schema...
[xjc] C:\Program Files\Java\tomcat50-jwsdp\jaxb\samples\vra\gen-src\primer
.po is not found and thus excluded from the dependency check
[xjc] Compiling file:/C:/Program Files/Java/tomcat50-jwsdp/jaxb/samples/vra/vra.xsd
[xjc] [WARNING] warning: "blockDefault" attribute of is not supported
[xjc] line 3 of xml.xsd

[xjc] [WARNING] warning: "finalDefault" attribute of is not suppo
[xjc] line 3 of xml.xsd

[xjc] [ERROR] A property with the same name "Source" is generated from more than one schema component. use a property customization to resolve this name collision.
[xjc] line 227 of vra.xsd

[xjc] [ERROR] (Relevant to above error) another one is generated from this
schema component.
[xjc] line 207 of vra.xsd

C:\Program Files\Java\tomcat50-jwsdp\jaxb\samples\vra\build.xml:32: unable to pa
rse the schema. Error messages should have been provided
So I need mechanism to customize the binding file,
I think, so that the class name is pre or ap pended to
the attribute name, whenever an attribute related class is generated. The example name collision is not much help because it does not show how to do name remangling in a
pattern directed way.
I do not want to generate a customization for each class, and attribute combination -

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-09
Points: 0

If this is a 1.0 related question, please direct those to (subscribe from first).

Also, without knowing what's in line 207 and 227, it is hard to diagnose the problem.

Joined: 2005-03-28
Points: 0

VRA Core metadata elements which can exist at any point in the
collection-work-image hierarchy.

and somewhat later,

VRA Core metadata attributes which can be applied to virtually any
element. Note that xml:lang should contain ISO 639 language codes, not
the English names of languages. Although the XML Schema defines xml:lang
as allowing ISO 639-2 (three-letter) codes, some validators will only
accept ISO 639-1 (two-letter) codes.

But I have this in my binding.ejb file:

Shouldn't that have create a class SourceElement?
which would not collide with the attribute source?