Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


xsd problem with ID

From: "Christophe" <christophe@-----------.--->
To: NULL
Date: 7/5/2006 5:25:00 PM

Hello,
I must imported XML FILE in SQL SERVER TABLE
I make diagram XSD
This xsd to create me 2 tables in my base
RELAX_CHANNEL and table RELAX_PROGRAM

I have to create connections (I am not sure that it's good)
my relationship create 1 column in 2 tables with name IDchannel
I fill the first table with channel (name), and the IDChannel (id channel)
but i don't fill the second table with the id channel !
i think have a error in my xsd !

****************************************************************************
*****
THIS MY XSD
****************************************************************************
*****
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:sql="urn:schemas-microsoft-com:mapping-schema">

<xsd:annotation>
 <xsd:appinfo>

  <sql:relationship name="Link_Channel"
          parent="RELAX_CHANNEL"
          parent-key="IdChannel"
          child="RELAX_PROGRAM"
          child-key="IdChannel" />


    </xsd:appinfo>
  </xsd:annotation>

 <xsd:element name="tvlistings" sql:is-constant="1">
  <xsd:complexType>
   <xsd:sequence>

    <xsd:element name="tvlisting" sql:is-constant="1">
    <xsd:complexType>
     <xsd:sequence>


      <xsd:element name="description" sql:is-constant="1">
      <xsd:complexType>
       <xsd:sequence>

        <xsd:element name="channel" sql:relation="RELAX_CHANNEL"
maxOccurs="unbounded" >
         <xsd:complexType>
          <xsd:simpleContent>
           <xsd:extension base="xsd:string">

<!-- this is my ID attribute IDchannel and i want copy to another table more
below -->

            <xsd:attribute name="ID" sql:field="IdChannel"
sql:datatype="int" type="xsd:int" />
           </xsd:extension>
          </xsd:simpleContent>
         </xsd:complexType>
        </xsd:element>
       </xsd:sequence>
       </xsd:complexType>
      </xsd:element>
      <xsd:element name="program" sql:relation="RELAX_PROGRAM"
sql:relationship="Link_Channel" maxOccurs="unbounded">
      <xsd:complexType>
       <xsd:sequence>
        <xsd:element name="broadcast" sql:is-constant="1">
        <xsd:complexType>
         <xsd:sequence>
          <xsd:element name="time" sql:field="PROG_HEURE"
sql:datatype="varchar(10)" type="xsd:string" maxOccurs="unbounded" />
          <xsd:element name="date" sql:field="PROG_DATE"
sql:datatype="varchar(10)" type="xsd:string" maxOccurs="unbounded" />
         </xsd:sequence>
        </xsd:complexType>
        </xsd:element>
        <xsd:element name="title" sql:field="title"
sql:datatype="nvarchar(250)" type="xsd:string" maxOccurs="unbounded" />
         <xsd:element name="subtitletitle" sql:field="subtitletitle"
sql:datatype="nvarchar(250)" type="xsd:string" maxOccurs="unbounded" />
         <xsd:element name="originaltitle" sql:field="originaltitle"
sql:datatype="nvarchar(250)" type="xsd:string" maxOccurs="unbounded" />
         <xsd:element name="originalsubtitle" sql:field="originalsubtitle"
sql:datatype="nvarchar(250)" type="xsd:string" maxOccurs="unbounded" />
         <xsd:element name="season" sql:field="season" sql:datatype="int"
type="xsd:int" maxOccurs="unbounded" />
       </xsd:sequence>

       <xsd:attribute name="ID" use="required" sql:field="IdProgram"
sql:datatype="int" type="xsd:int" />

<!-- i want to fill my second table with IdChannel in the first table -->

       </xsd:complexType>
      </xsd:element>
     </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
</xsd:schema>
****************************************************************************
*****




transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent