Expand|Select|Wrap|Line Numbers
- <HouseInfo>
- <HouseNumber>1</HouseNumber>
- <HouseLog>
- <RoomInfo>
- <RoomNumber>1</RoomNumber>
- <Timestamp>2017-12-29T12:16:51</Timestamp>
- <Furnitures>
- <Table>
- <Color>Blue</Color>
- <Height>23</Height>
- </Table>
- </Furnitures>
- <ToolCounts>
- <Scope>1</Scope>
- </ToolCounts>
- </RoomInfo>
- <RoomInfo>
- <RoomNumber>2</RoomNumber>
- <Timestamp>2017-12-29T15:43:23</Timestamp>
- <Furnitures>
- <Table>
- <Color>Black</Color>
- <Height>35.2</Height>
- </Table>
- </Furnitures>
- <ToolCounts>
- <Scope>1</Scope>
- </ToolCounts>
- <Bathroom>
- <Code>1234</Code>
- <Faucets>3></Faucets>
- </Bathroom>
- </RoomInfo>
- <RoomInfo>
- <RoomNumber>2</RoomNumber>
- <Timestamp>2017-12-29T15:45:48</Timestamp>
- <Furnitures>
- <Table>
- <Color>Red</Color>
- <Height>98.56</Height>
- </Table>
- </Furnitures>
- <ToolCounts>
- <Scope>1</Scope>
- </ToolCounts>
- <Bathroom>
- <Code>1234</Code>
- <Faucets>2></Faucets>
- </Bathroom>
- </RoomInfo>
- </HouseLog>
- </HouseInfo>
Expand|Select|Wrap|Line Numbers
- <?xml version="1.0" encoding="utf-8"?>
- <!-- Created with Liquid Technologies Online Tools 1.0 (https://www.liquid-technologies.com) -->
- <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:element name="HouseInfo">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="HouseNumber" type="xs:unsignedByte" />
- <xs:element name="HouseLog">
- <xs:complexType>
- <xs:sequence>
- <xs:element maxOccurs="unbounded" name="RoomInfo">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="RoomNumber" type="xs:unsignedByte" />
- <xs:element name="Timestamp" type="xs:dateTime" />
- <xs:element name="Furnitures">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="Table">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="Color" type="xs:string" />
- <xs:element name="Height" type="xs:decimal" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="ToolCounts">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="Scope" type="xs:unsignedByte" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="0" name="Bathroom">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="Code" type="xs:unsignedShort" />
- <xs:element name="Faucets" type="xs:string" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:schema>
I have a C# application and in that SQLXMLBulkLoad library is being used to load the XML content to DB. I pass the XSD and XML as parameters to the Execute function. Now am getting below error.
relationship expected on 'HouseLog'.
What I have tried:
I tried adding- sql:is-constant="1"
to HouseLog and some other tags and that removes the above error, but brings up another error saying that it cannot find specific columns in DB even though they exist.
So i guess, the problem is - i need to define relationships properly in the XSD and i have no idea how to do it. Hope someone can suggest some solutions.
Please give me some samples as am quite new to this schema to DB conversation and have ran out of ideas. Thanks in advance.