IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: Stephen Aras
About
User Name: Stephen Aras
Forum Rank: Newbie
Real Name:
Location Springfield, MA
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Thursday, November 19, 2009
Last Visit: Friday, November 20, 2009 1:26:51 PM
Number of Posts: 2
[0.01% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: Cannot generate sample XML in XMLSpy
Posted: Friday, November 20, 2009 12:54:48 PM
Thanks Island. I'm new to the forum and wonder if I'd get a quick reply. When you mentioned that the worx example is bad, what do you mean by that? Recursive elements seem like a valid concept. If I had a machine that had a function and a subfunction and a subfunction within that subfunction, it seems to me that recursion is the only way to describe that variable hierarchy.

I'm lost. I tried A and B below. If I do get a good xml doc, will it validate?

A.

<Product_Info xsi:noNamespaceSchemaLocation="Product_Info.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Product_Class Product_Class_Name="Software">
<Product_Type Product_Type_Name="Complicated">
<Functions> <Function Function_Name="Func1"></Function>
<Function Function_Name="Func2">
<Function Function_Name="SubFunction1"></Function>
<Function Function_Name="SubFunction2"></Function>
</Function>
<Function Function_Name="Func3"></Function>
</Functions>
</Product_Type>
</Product_Class>
</Product_Info>

B.

<Product_Info xsi:noNamespaceSchemaLocation="Product_Info.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Product_Class Product_Class_Name="Software">
<Product_Type Product_Type_Name="Complicated">
<Functions>
<Function Function_Name="Func1"></Function>
<Functions>
<Function Function_Name="SubFunction1"></Function>
<Function Function_Name="SubFunction2"></Function>
</Functions>
<Function Function_Name="Func3"></Function>
</Functions>
</Product_Type>
</Product_Class>
</Product_Info>
Topic: Cannot generate sample XML in XMLSpy
Posted: Thursday, November 19, 2009 5:52:59 PM
I created a schema that has recursive nodes. I used this example from wrox.

Wrox sample

The file validates, but when I try to have XMLSpy create a sample xml doc, a window briefly appears....then shuts down.

Any ideas?

Thanks.

Steve

<xs:element name="nodes">
<xs:complexType>
<xs:sequence>
<xs:element ref="node" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name="node">
<xs:complexType>
<xs:sequence>
<xs:element ref="node" maxOccurs="unbounded"/>
<xs:element name="text" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.