It seems like the recursion is not in the trimXName method. Even so, I went ahead and tried a simple subclass, and it also turned out to be recursive. The trimXName method is being called multiple times for each element. Based on this, it seems like I would need to override a method somewhere else.
-----Original Message----- From: Dennis Sosnoski [mailto:d...@sosnoski.com] Sent: Saturday, September 26, 2009 12:45 AM To: JiBX users Subject: Re: [jibx-users] strip-suffixes is recursive? This is by design, since some schemas use combinations of added words in different orders. It'd be possible to write the code so that it would only remove at most one instance of each suffix, but that seems more trouble than it's worth. You should be able to easily change this behavior with a trivial subclass of DefaultNameConverter - just override trimXName(String) and do it your way. - Dennis Dennis M. Sosnoski XML and Web Services in Java Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117 jcaristi wrote: > In attempting to use the strip-suffixes codegen option to remove the word > "Type" from the end of my complex types. However, some of my complex types > have the word "Type" in the name as well as a "Type" suffix. In this case, > JiBX seems to recursively remove the suffix. In the following example, I > would expect to end up with "VehicleType" and "Vehicle". Instead, I end up > with "Vehicle" (two instances of "Type" removed) and "Vehicle1" (one > instances of "Type" removed and class renamed to avoid conflict). This is > definitely not what I want. > > Is this by design? Is there a way around this or do I have to code my own > name converter? > > <xsd:complexType name="VehicleTypeType"> > <xsd:simpleContent> > <xsd:extension base="xsd:string"> > <xsd:attribute name="Id" type="xsd:int" > use="required" /> > </xsd:extension> > </xsd:simpleContent> > </xsd:complexType> > > <xsd:complexType name="VehicleType"> > <xsd:simpleContent> > <xsd:extension base="xsd:string"> > <xsd:attribute name="Id" type="int" > use="required" /> > </xsd:extension> > </xsd:simpleContent> > </xsd:complexType> > > > ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users STATEMENT OF CONFIDENTIALITY: The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify WHI Solutions immediately at g...@whisolutions.com, and destroy all copies of this message and any attachments. ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users