|
We're trying to follow your example on page 2 of adding an element. We're doing this in memory - adding some complex types, compiling, then trying to go back and access those elements to add the necessary children. We don't want to save to disk until we've added all the children of the children, etc.
In using the loop -
For Each parentElement In schema.Elements.Values
Next
-
we can only get to the root element.
Sample portion of our dynamic schema is included below - only element we can get to is Orders...can't get to the child Order element or the child Customer element. We did a print out of the schema.Elements.Values.Count throughout our loop and it is only 1 - but this is what it prints out below.
<?xml version="1.0" encoding="utf-16"?>
<xs:schema elementFormDefault="qualified" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Orders">
<xs:complexType>
<xs:sequence>
<xs:element name="Order">
<xs:complexType>
<xs:sequence />
</xs:complexType>
</xs:element>
<xs:element name="Customer">
<xs:complexType>
<xs:sequence />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
--Note we also tried the items collection before compiling but it only gets the "top" level items...it doesn't read/find nested items/elements. I found that detail on a Microsoft webcast. I guess this just gets top level elements also...??
Thanks.
Sincerely,
Wendy Attenberger
|