[xsde-users] add suffix to attribute getter/setter

Boris Kolpackov boris at codesynthesis.com
Wed May 30 10:06:01 EDT 2012


Hi Ivan,

Ivan Le Lann <ivan.lelann at free.fr> writes:

> Is there a way with XSDe/Hybrid to control generated getter/setter
> method names for attributes ? (without changing the xsd attribute
> name, obviously)
>
>     <xs:complexType>
>       <xs:attribute name="Name" type="xs:string"/>
>     </xs:complexType>
> 
> would give getter/setter "Name__attr" instead of "Name".

No, there is currently no such mechanism. If the names of attributes
in your schema are not used for any other constructs (e.g., type or
element names), then you could achieve this using the --reserved-name
option. For example:

--reserved-name Name=Name__attr

You could probably generate an options file with a list of these
options for all of your attributes with a simple sed script.

Boris



More information about the xsde-users mailing list