Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Annotated xsd issue

Status
Not open for further replies.

gswafford1

Programmer
Mar 14, 2010
1
US
The error i'm getting when building the output XML is this:

"Parent tag ID 2 is not among the open tags. FOR XML EXPLICIT requires parent tags to be opened first. Check the ordering of the result set."

I'm looking to generated this type of output
<RootNode>
<Header>
<Footer>
</RootNode>

My Annotated XSD looks like this. Notice the header and the footer are child nodes under the RootNode.


<sql:relationship
name="HeaderReport"
parent="Table1"
parent-key="Id"
child="vwHeaderReport"
child-key="Id"
/>

<sql:relationship
name="FooterReport"
parent="Table1"
parent-key="Id"
child="vwFooterReport"
child-key="Id"
/>


<xs:element name="RootNode" sql:relationship="Table1">
<xs:complexType>
<xs:sequence>
<xs:element name="Field1" type="xs:integer" sql:field="Field1" sql:hide="true"/>
<xs:element ref="Header" minOccurs="1" maxOccurs="1" />
<xs:element ref="Footer" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Header" sql:relation="vwHeaderReport" sql:relationship="HeaderReport">
<xs:complexType>
<xs:sequence>
<xs:element ref="RunDate" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Footer" sql:relation="vwFooterReport" sql:relationship="FooterReport">
<xs:complexType>
<xs:sequence>
<xs:element ref="RunDate" />
</xs:sequence>
</xs:complexType>
</xs:element>

Could it be my views?
 
><xs:element name="RootNode" sql:relationship="Table1">
[tt]<xs:element name="RootNode" sql:[red]relation[/red]="Table1">[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top