Hi, Instead of blanking out the value, remove it. (I wish that an empty, blank, value would be signalled as missing but it doesn't. You have to remove the tag. Also, if you remove the tag but there's a default value in your XSD... hasXXX() still returns false whereas it should return true :-( )
regards, --Tim > -----Original Message----- > From: Bora, Prantor [mailto:[EMAIL PROTECTED] > Sent: maandag 15 maart 2004 19:26 > To: [EMAIL PROTECTED] > Subject: [castor-dev] primitive type hasXXX() method return > true always > > > > Hi, > We are seeing this behavior that for primitive types fields. > The hasXXX() method generated always returns true even when > our xml does not have a value. Any idea why. I downloaded > Castor's example and ran InvoiceTest.java by adding > "System.out.println("my quantity = " + > item[i].hasQuantity());" and it returned true even after I > blanked out the quantity field in the xml. > > C:\j2sdk1.4.1\bin\java -cp > bin;lib\castor-0.9.5.3.jar;lib\jakarta-oro-2.0.8.jar;lib\xerce > sImpl.jar test.InvoiceTest > > Prantor > > ----------------------------------------------------------- > 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
