| Stephen Aras |
| Newbie |
|
| Springfield, MA |
|
|
| None Specified |
|
| Thursday, November 19, 2009 |
| Friday, November 20, 2009 1:26:51 PM |
2 [0.01% of all post / 0.00 posts per day] |
|
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>
|
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>
|
|