hoochimama20
Programmer
Hi,
I have the following xml file:
-----------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<bulletin>
<story>
<category>E</category>
<storyname>53952</storyname>
<image src="N.jpg" caption="A" alt="As" credit="AP"/>
</story>
-----------------------------------------------------------
That I want to XmlBulkLoad into a database table with schema News(category, storyname, src, caption). I am trying to write an Annotated xsd to map the elements from the xml file to the columns in the database table News. This is my attempt at an xsd so far:
-----------------------------------------------------------
<?xml version="1.0" encoding="windows-1252" standalone="no"?>
<xsd:schema xmlns:msch="urn:schemas-microsoft-com:mapping-schema" xmlns:dt="urn:schemas-microsoft-com:datatypes" xmlns:xsd=" <xsd:element name="bulletin" type="bulletin_type" msch:is-constant="1"/>
<xsd:complexType name="bulletin_type">
<xsd:all>
<xsd:element name="story" type="story_type" msch:relation="News"/>
</xsd:all>
</xsd:complexType>
<xsd:element name="story" type="story_type" msch:relation="News"/>
<xsd:complexType name="story_type">
<xsd:all>
<xsd:element name="category" msch:field="Category"/>
<xsd:element name="storyname" msch:field="StoryName"/>
<xsd:element name="image" msch:relation="News" type="image_type"/>
</xsd:all>
</xsd:complexType>
<xsd:element name="category" msch:field="category"/>
<xsd:element name="storyname" msch:field="storyname"/>
<xsd:element name="image" type="image_type" msch:relation="News"/>
<xsd:complexType name="image_type">
<xsd:attribute name="src" msch:field="src"/>
<xsd:attribute name="caption" msch:field="caption"/>
</xsd:complexType>
<xsd:attribute name="src" msch:field="src"/>
<xsd:attribute name="caption" msch:field="caption"/>
</xsd:schema>
-----------------------------------------------------------
Does anyone know how I can write this XSD to map the attributes of image to the 2 columns src and caption in the table News.
I have the following xml file:
-----------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<bulletin>
<story>
<category>E</category>
<storyname>53952</storyname>
<image src="N.jpg" caption="A" alt="As" credit="AP"/>
</story>
-----------------------------------------------------------
That I want to XmlBulkLoad into a database table with schema News(category, storyname, src, caption). I am trying to write an Annotated xsd to map the elements from the xml file to the columns in the database table News. This is my attempt at an xsd so far:
-----------------------------------------------------------
<?xml version="1.0" encoding="windows-1252" standalone="no"?>
<xsd:schema xmlns:msch="urn:schemas-microsoft-com:mapping-schema" xmlns:dt="urn:schemas-microsoft-com:datatypes" xmlns:xsd=" <xsd:element name="bulletin" type="bulletin_type" msch:is-constant="1"/>
<xsd:complexType name="bulletin_type">
<xsd:all>
<xsd:element name="story" type="story_type" msch:relation="News"/>
</xsd:all>
</xsd:complexType>
<xsd:element name="story" type="story_type" msch:relation="News"/>
<xsd:complexType name="story_type">
<xsd:all>
<xsd:element name="category" msch:field="Category"/>
<xsd:element name="storyname" msch:field="StoryName"/>
<xsd:element name="image" msch:relation="News" type="image_type"/>
</xsd:all>
</xsd:complexType>
<xsd:element name="category" msch:field="category"/>
<xsd:element name="storyname" msch:field="storyname"/>
<xsd:element name="image" type="image_type" msch:relation="News"/>
<xsd:complexType name="image_type">
<xsd:attribute name="src" msch:field="src"/>
<xsd:attribute name="caption" msch:field="caption"/>
</xsd:complexType>
<xsd:attribute name="src" msch:field="src"/>
<xsd:attribute name="caption" msch:field="caption"/>
</xsd:schema>
-----------------------------------------------------------
Does anyone know how I can write this XSD to map the attributes of image to the 2 columns src and caption in the table News.