Hi Zsolt,
Thanks for the patch, I'll get it checked in ASAP. --Keith Zsolt Kovacs wrote: > > Hello, > > I have been testing the XML schema generation class of castor ( > org.exolab.castor.xml.schema.util.XMLInstance2SchemaHandler ) and I think > I have found a minor bug when it guesses the type of an simple element > which actually has no value, ie. it looks like this <EmptyElement/>. Due > to this missing data the StateInfo.buffer will be null which will generate > a NullPointerException when it is converted to string (see line 211). > > So I could make it work with this simple change against the cvs version: > > diff -r1.2 XMLInstance2SchemaHandler.java > 208c208 > < if (sInfo.element.getType() == null) { > --- > > if ((sInfo.element.getType() == null) && (sInfo.buffer != null)) > { > > With this change the generation will work obviously it would not provide > the 'type' attribute for the corresponding element, ie. it will generate > something like this <xsd:element name="EmptyElement"/>. > > BTW we have been using castor xml for some time, and we have found it > extremly usefull. Now we started to use its xml.schema package and it > looks also promising as a viable replacement of xerces abstract schema > implementaion. > > Regards, > > Zsolt > > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev