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.
Generating sample XML document from a schema with no namespace does not generate elements. System: Product Version: NetBeans IDE Dev (Build 200807101204) Java: 1.6.0_05; Java HotSpot(TM) 64-Bit Server VM 1.6.0_05-b13-52 System: Mac OS X version 10.5.4 running on x86_64; MacRoman; en_US (nb) Steps: 1. Create a schema and clear the namespace field this creating a schema with no namespace 2. Add a complex type and some elements to the complex type 3. Add an element of built-in type of the complex type just created 4. In projects window right click the schema and choose Generate Smaple XML 5. XML sample doc is created but lacks element generation 6. You can repeat 1-4 but keep namespace for the schema and elemebts are generated.
*EDIT* for step 3 select use existing type not built-in type
Tony, even with namespace, the elements are not getting generated. Pls can you confirm? Also, let me know what is displayed in the Root Element drop down box in both cases? thx
With a namespace elements are getting created for me, but not exactly correctly, see issue 139764 When there is no namespace then there are zero elements created. In both cases the rootElement displayed newElement Followed these steps for nonamespace schema and schema with namespace 1. New Complex type 2. add two elements to the complex type 3. Add a global element of type of your complex type 5. save 6. generate sample XML
*** Issue 132452 has been marked as a duplicate of this issue. ***
This is working for me. Can you confirm that after adding a global element of type of the complex type, you are not using prefix i.e ur xsd should not have something like this: xsd:element name="newElement" type="tns:newComplexType"></xsd:element> Here the element is using a "tns" prefix which cannot be mapped to any namespace. The xsd is incorrect and hence, a empty xml is generated.
Correct, there is not anything like that. Here is the XSD <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xsd:complexType name="newComplexType"> <xsd:sequence> <xsd:element name="newElement"/> <xsd:element name="newElement1"/> </xsd:sequence> </xsd:complexType> <xsd:element name="newElement" type="newComplexType"></xsd:element> </xsd:schema>
fixed changeset 8014120dbe39 in main details: http://hg.netbeans.org/main?cmd=changeset;node=8014120dbe39
Integrated into 'main-golden', available in NB_Trunk_Production #324 build Changeset: http://hg.netbeans.org/main/rev/8014120dbe39 User: sonali@netbeans.org Log: Fix for issue#139763 Generate Sample XML document does not work for noNamespace shcema
Fix Verified Product Version: NetBeans IDE Dev (Build 200807170007) Java: 1.6.0_05; Java HotSpot(TM) 64-Bit Server VM 1.6.0_05-b13-52 System: Mac OS X version 10.5.4 running on x86_64; MacRoman; en_US (nb)