The "value-name" attribute is actually for nested components (sorry for the confusion). In your case, the element and its type had the same name (Con), which was hiding the fact that only the type was being generated, not the element. For demonstration purposes, I renamed the type with the following schema as the result:
<?xml version="1.0" encoding="UTF-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test.com/test/me" xmlns="http://test.com/test/me" elementFormDefault="qualified"> <xs:complexType name="ConType"> <xs:attribute name="attr1" type="xs:double" use="required" /> <xs:attribute name="attr2" type="xs:double" use="required" /> </xs:complexType> <xs:element name="Con" type="ConType" /> </xs:schema> Based on the above schema, this custom.xml file does what you want. A "FooType" class is generated. <schema-set xmlns:xs="http://www.w3.org/2001/XMLSchema" package="test"> <schema name="test.xsd"> <complexType path="complexty...@name=contype]" class-name="FooType"/> </schema> </schema-set> ________________________________ From: Haggie, Tom [mailto:tom.hag...@sap.com] Sent: Friday, May 29, 2009 12:55 PM To: JiBX users Subject: Re: [jibx-users] [LIKELY JUNK]Re: Trouble trying to rename a class generated bycodegen Using value-name rather than class-name doesn't seem to make any difference. Neither does using path as opposed to name to define the element to match. Thanks anyway. From: Caristi, Joe [mailto:jcari...@whisolutions.com] Sent: May 28, 2009 4:47 AM To: JiBX users Subject: [LIKELY JUNK]Re: [jibx-users] Trouble trying to rename a class generated bycodegen This tutorial shows how to do it (page 8): https://www.ibm.com/developerworks/java/tutorials/j-jibx2/ Here is an example of how we rename a generated class using the "value-name" option. Note the xpath-like syntax which pinpoints the exact item you want to rename. <schema name="PSS.xsd"> <element path="eleme...@name=vehicletypesget]/complexType/sequence/eleme...@name=psrequestheader]" value-name="NewName" /> </schema> ________________________________ From: Haggie, Tom [mailto:tom.hag...@sap.com] Sent: Wednesday, May 27, 2009 5:53 PM To: jibx-users@lists.sourceforge.net Subject: [jibx-users] Trouble trying to rename a class generated by codegen Hi Everyone, I'm trying to rename a class generated by code gen as it's filename is invalid on Windows (Con.java) reading the docs it looks like it should be easy: <schema-set prefer-inline="true" generate-all="true"> <schema name="Test.xsd" > <element name="Con" class-name="Foo" /> </schema> </schema-set> But this doesn't seem to rename the class, is there something I'm missing? I've put a more detailed description of the problem here: http://stackoverflow.com/questions/918153 Thanks -*TOM*- ________________________________ 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. ________________________________ 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.
------------------------------------------------------------------------------ Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users