Click here to Skip to main content
15,892,298 members
Home / Discussions / XML / XSL
   

XML / XSL

 
QuestionMSXML 0xC00000FD stack overflow Pin
agent_hunt26-Dec-05 1:06
agent_hunt26-Dec-05 1:06 
QuestionHow to Get the Value when we specify the name .. Pin
zxc8925-Dec-05 19:35
zxc8925-Dec-05 19:35 
Questionimage compression project Pin
Femi Buroh25-Dec-05 10:17
Femi Buroh25-Dec-05 10:17 
Questionextracting data from xml and loading into dataset Pin
wpcolleen20-Dec-05 1:31
wpcolleen20-Dec-05 1:31 
QuestionEasy JPG question! Pin
SpeBeeTo19-Dec-05 9:38
SpeBeeTo19-Dec-05 9:38 
AnswerRe: Easy JPG question! Pin
Michael Flanakin29-Dec-05 3:58
Michael Flanakin29-Dec-05 3:58 
GeneralRe: Easy JPG question! Pin
SpeBeeTo30-Dec-05 15:08
SpeBeeTo30-Dec-05 15:08 
QuestionTrouble using sql:relation/sql:relationship in xsd file ... Pin
cmacgowan19-Dec-05 9:17
cmacgowan19-Dec-05 9:17 
Trouble using sql:relation/sql:relationship in xsd file ...


Hi ...

I am attempting to use the sql:relation annotation and am having some troubles. I have used it successfull with the MS Sample (Customer / Order) where all the data is contained in elements (example below).

<code><ROOT>
<Customers>
<CustomerID>1111</CustomerID>
<SynchID>700</SynchID>
<CompanyName>Sean Chai</CompanyName>
<City>NY</City>
<Order OrderID="1" />
<Order OrderID="2" />
</Customers>
</ROOT>

In the xml that I am having trouble with the data is contained in attributes. In the code below I get the following
error when executing the bulk insert.

Any comments ?
Thanks !!
Chris



//////////////////////////////////////////////////////////////////////////
// error message
<?xml version="1.0"?><Result State="FAILED"><Error><HResult>0x80004005</HResult><Description><![CDATA[Schema: the parent/child table of the relationship on 'surface' does not match.]]></Description><Source>Schema mapping</Source><Type>FATAL</Type></Error></Result>


//////////////////////////////////////////////////////////////////////////
// xsd file
<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="MacgowanTest_Atmospheric_Surface"
parent="MacgowanTestRWISRawAtmospheric"
parent-key="SystemId RpuId"
child="MacgowanTestRWISRawSurface"
child-key="SystemId RpuId" />
</xsd:appinfo>
</xsd:annotation>

<xsd:element name="site" sql:relation="MacgowanTestRWISRawAtmospheric" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="sensors" sql:relation="MacgowanTestRWISRawSurface"
sql:relationship="MacgowanTest_Atmospheric_Surface">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="surface" sql:relation="MacgowanTestRWISRawSurface"
sql:relationship="MacgowanTest_Atmospheric_Surface" >
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" sql:field="SensorId"/>
<xsd:attribute name="datetime" type="xsd:date" sql:field="ObsDateTime" />
<xsd:attribute name="surfacecondition" type="xsd:string" sql:field="SurfaceCondition"/>
<xsd:attribute name="surfacetemp" type="xsd:string" sql:field="SurfaceTemperature"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>

<xsd:attribute name="sysid" type="xsd:string" sql:field="SystemId"/>
<xsd:attribute name="rpuid" type="xsd:string" sql:field="RpuId"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>



//////////////////////////////////////////////////////////////////////////
// xml data file
<?xml version="1.0"?>
<odot_rwis_site_info>
<site id="200000" number="1" sysid="200" rpuid="0" name="1-SR127 @ SR249" longitude="-84.554946" latitude="41.383527">
<atmospheric datetime="12/05/2005 03:48:00 PM" airtemp="-490" dewpoint="-800" relativehumidity="73" windspeedavg="11" windspeedgust="19" winddirectionavg="265" winddirectiongust="295" pressure="65535" precipitationintensity="None" precipitationtype="None" precipitationrate="0" precipitationaccumulation="-1" visibility="2000" />
<sensors>
<surface id="0" datetime="12/05/2005 03:48:00 PM" name="North Bound Driving Lane" surfacecondition="Dry" surfacetemp="1900" freezingtemp="32767" chemicalfactor="255" chemicalpercent="255" depth="32767" icepercent="255" subsurfacetemp="450" waterlevel="0">
<traffic datetime="12/05/2005 03:48:00 PM" occupancy="0" avgspeed="82" volume="21" sftemp="1900" sfstate="255">
<normalbins>
<bin datetime="12/05/2005 03:48:00 PM" binnumber="0" bincount="7" />
<bin datetime="12/05/2005 03:48:00 PM" binnumber="1" bincount="0" />
</normalbins>
<longbins>
<bin datetime="12/05/2005 03:48:00 PM" binnumber="2" bincount="0" />
<bin datetime="12/05/2005 03:48:00 PM" binnumber="3" bincount="0" />
<bin datetime="12/05/2005 03:48:00 PM" binnumber="4" bincount="1" />
<bin datetime="12/05/2005 03:48:00 PM" binnumber="5" bincount="0" />
</longbins>
</traffic>
</surface>
<surface id="1" datetime="12/05/2005 03:48:00 PM" name="Bridge Deck Simulator" surfacecondition="Other" surfacetemp="-60" freezingtemp="32767" chemicalfactor="255" chemicalpercent="255" depth="32767" icepercent="255" subsurfacetemp="-999999" waterlevel="0" />
</sensors>
</site>
<site id="200001" number="2" sysid="200" rpuid="1" name="2-Hardin County Garage" longitude="-83.6148588" latitude="40.6305358">
<atmospheric datetime="12/05/2005 03:49:00 PM" airtemp="-590" dewpoint="-900" relativehumidity="75" windspeedavg="9" windspeedgust="22" winddirectionavg="303" winddirectiongust="299" pressure="65535" precipitationintensity="None" precipitationtype="None" precipitationrate="0" precipitationaccumulation="-1" visibility="2000" />
<sensors>
<surface id="0" datetime="12/05/2005 03:49:00 PM" name="Bridge Deck Simulator" surfacecondition="Other" surfacetemp="-410" freezingtemp="32767" chemicalfactor="255" chemicalpercent="255" depth="32767" icepercent="255" subsurfacetemp="300" waterlevel="0" />
</sensors>
</site>
</odot_rwis_site_info></code>
QuestionXPath expression Pin
Andy H14-Dec-05 22:37
Andy H14-Dec-05 22:37 
AnswerRe: XPath expression Pin
Stuart Dootson15-Dec-05 7:26
professionalStuart Dootson15-Dec-05 7:26 
AnswerRe: XPath expression Pin
Michael Flanakin3-Jan-06 3:09
Michael Flanakin3-Jan-06 3:09 
QuestionTool for creating xml from database table? Pin
pankazmittal14-Dec-05 11:35
pankazmittal14-Dec-05 11:35 
AnswerRe: Tool for creating xml from database table? Pin
mysorian9-Jan-06 3:14
professionalmysorian9-Jan-06 3:14 
QuestionElements vs Attributes Pin
monrobot1313-Dec-05 10:17
monrobot1313-Dec-05 10:17 
AnswerRe: Elements vs Attributes Pin
Sushant_Mathur13-Dec-05 21:16
Sushant_Mathur13-Dec-05 21:16 
GeneralRe: Elements vs Attributes Pin
Shem Su6-Jan-06 0:44
Shem Su6-Jan-06 0:44 
QuestionHow To Load &amp; Validat XML file with XSD file using XML .Net Parser Pin
zxc8913-Dec-05 0:37
zxc8913-Dec-05 0:37 
AnswerRe: How To Load &amp;amp; Validat XML file with XSD file using XML .Net Parser Pin
DavidNohejl20-Dec-05 1:52
DavidNohejl20-Dec-05 1:52 
GeneralRe: How To Load &amp;amp;amp; Validat XML file with XSD file using XML .Net Parser Pin
zxc8920-Dec-05 1:58
zxc8920-Dec-05 1:58 
QuestionString vs. XML file Pin
sonicsqwirl11-Dec-05 21:27
sonicsqwirl11-Dec-05 21:27 
AnswerRe: String vs. XML file Pin
Per Nilsson13-Dec-05 22:47
Per Nilsson13-Dec-05 22:47 
GeneralRe: String vs. XML file Pin
Michael Flanakin29-Dec-05 4:01
Michael Flanakin29-Dec-05 4:01 
QuestionXSL/XML space is different from javascript Pin
ChiranjibC9-Dec-05 6:49
ChiranjibC9-Dec-05 6:49 
AnswerRe: XSL/XML space is different from javascript Pin
Michael Flanakin29-Dec-05 4:06
Michael Flanakin29-Dec-05 4:06 
QuestionHow to load xml file from resources using msxml? Pin
onestab9-Dec-05 2:25
onestab9-Dec-05 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.