[xsd-users] --enumerator-regex usage.

Boris Kolpackov boris at codesynthesis.com
Wed Jul 22 02:29:34 EDT 2009


Hi Bill,

Bill Pringlemeir <bpringle at sympatico.ca> writes:

>   <xs:simpleType name="bar">
>     <xs:restriction base="xs:string">
>       <xs:enumeration value="foo" />
>       <xs:enumeration value="blip" />
>     </xs:restriction>
>   </xs:simpleType>
> 
>   <xs:simpleType name="baz">
>     <xs:restriction base="xs:string">
>       <xs:enumeration value="foo" />
>       <xs:enumeration value="blonk" />
>     </xs:restriction>
>   </xs:simpleType>
> 
> I turned on --name-regex-trace and the output looks like this for
> enums,
> 
> ...
> enumerator name: 'foo'
> ...
> 
> I was hoping for,
> 
> enumerator name: 'bar foo'
> enumerator name: 'baz foo'

Yes, the --enumerator-regex is applied on local, unqualified names.
It was initially meant to allow changing the naming convention (e.g.,
making all enumerators upper-case) rather than mangling individual
enumerator values, though people seem to be using them for this as 
well.

Probably the best way to address this would be to add an option
like --qualified-regex-names which makes all the --*-regex options
work on qualified names. I've added this to my TODO list.

Boris




More information about the xsd-users mailing list