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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

generate XML against XSD from SQL db

Status
Not open for further replies.

leoliang

Programmer
Dec 9, 2003
27
CN
Hi,



I need to export a XML file against XSD file from a table in my SQL database.

the XSD file is given by another company, my table contains all the required data.

Could anyone please help me this?

thanks
 
If I understand your question correctly then from BOL

Code:
<xsd:schema xmlns:xsd="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL] 
            xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
  <xsd:element name="Order" sql:relation="Sales.SalesOrderHeader">
     <xsd:complexType>
       <xsd:attribute name="SalesOrderID" type="xsd:string" /> 
       <xsd:attribute name="CustomerID"   type="xsd:string" /> 
       <xsd:attribute name="OrderDate"    type="xsd:date" /> 
       <xsd:attribute name="DueDate"  /> 
       <xsd:attribute name="ShipDate"  type="xsd:time" /> 
     </xsd:complexType>
  </xsd:element>
</xsd:schema>


if you want to explicity map the schema & your sql data then just add the sql:field identifier - for example

Code:
<xsd:attribute name="ShipDate"  type="xsd:time" sql:field="TimeStamp" />
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top