This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The problem was due to insertion of the comments between the the open and close tags (http://schema2beans.netbeans.org/issues/show_bug.cgi?id=132795) <TAG>some_comment</TAG> even if there we no comments, a blank line was added preventing the schema to validate an empty bean. I have attached a workaround that I have made. Probably It can be done better, but I had problems opening the file in my IDE (NetBeans). The patch is for JavaBeanClass.java I will attach it too *** JavaBeanClass.java 2007-10-03 11:28:10.000000000 +0200 --- /opt/NBSOURCE/schema2beans/dev/src/org/netbeans/modules/schema2beansdev/JavaBeanClass.java 2008-04-14 23:34:44.000000000 +0200 *************** *** 1549,1555 **** // Go over the attributes for (int i = 0; i < size; i++) { Property a = (Property) attrList.get(i); ! if (!a.isAttribute()) { hasSubElements = true; continue; } --- 1549,1556 ---- // Go over the attributes for (int i = 0; i < size; i++) { Property a = (Property) attrList.get(i); ! if (!a.isAttribute() && !"comment".equals(a.dtdName)) { ! //System.out.println("SCANTIDEBUG" + a.dtdName ); hasSubElements = true; continue; } *************** *** 3123,3128 **** --- 3124,3132 ---- } protected void genWriteAttr(Property a, String varName) throws IOException { + if("comment".equals(a.dtdName)){ + return; + } boolean isScalar = a.isScalar(); String dtdName = a.dtdName; String namespace = a.getNamespace();
Created attachment 60155 [details] Diff Path
I think the patch would introduce problems when you have an element named "comment", so as such I can't apply it to the code base.
*** This bug has been marked as a duplicate of bug 132795 ***