Hi Stefan, Castor doesn't currently create inner-classes, though it's something that's on the list. I added a while back the underlying infrastructure needed for this to the javasource package, we just haven't added this support to the source generator yet.
For now you'll need to use a binding file to either change the name or the package of the generated classes so that they don't conflict. For more information on the binding file, see here: http://castor.exolab.org/sourcegen.html#Binding-File --Keith > Stefan H Westlund wrote: > > Hi! > Is it possible to generate the java source objects by hierarchy? > > Ex. I have an XML like: > > <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?> > <root> > <s> > <rules begin="1"> > </rules> > </s> > <rules model="parse" /> > <root> > > > Note: Observe the two 'rules'-elements which occurs in different > places in the XML. > > > > When I create the xsd it will look like: > > <?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> > <xs:element name="root"> > <xs:complexType> > <xs:sequence> > <xs:element name="s" minOccurs="0" maxOccurs="unbounded"> > <xs:complexType> > <xs:sequence> > <xs:element name="rules" minOccurs="0" maxOccurs="unbounded"> > <xs:complexType> > <xs:attribute name="begin" type="xs:string" use="required" /> > </xs:complexType> > </xs:element> > </xs:sequence> > </xs:complexType> > </xs:element> > <xs:element name="rules" minOccurs="0" maxOccurs="1"> > <xs:complexType> > <xs:attribute name="model" type="xs:string" use="required" /> > </xs:complexType> > </xs:element> > </xs:sequence> > </xs:complexType> > </xs:element> > <xs:schema> > > > > It's obvious that the two 'rules'-element are of different types and > that just one of the are going to be generated (I have tried). > When I did use JAXB they were created in a hierarchy and were never in > conflict with eachother. > > Ex. Like: (primer is the package) > primer.Root > primer.Root.S > primer.Root.S.Rules > primer.Root.Rules > > Is it possible to generate the Java-objects like this with Castor? > > Best Regard// > Stefan H Westlund > > PS. The point is that I already has got the XML in this manner from a > distant server, which I can't control. DS. ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
