473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Please help, date problem with XSD file

I am getting the error:
Invalid character value for cast specification
In my xml file the date is like this:
2004-09-28T00:00:00.0000000-04:00

Because of the field eventdate which is dt:datetime in my
xsd file.

******* MY XSD file
<?xml version="1.0" ?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"
xmlns:sql="urn:schemas-microsoft-com:xml-sql" >

<ElementType name="eventdate" dt:type="DateTime"/>
<ElementType name="ReferenceNO" dt:type="varchar(50)" />
<ElementType name="EventDesciption" dt:type="ntext(16)" />
<ElementType name="ModuleName" dt:type="char(20)" />
<ElementType name="ModuleID" dt:type="char(20)" />
<ElementType name="created_by" dt:type="char(20)" />

<ElementType name="ROOT" sql:is-constant="1">
<element type="Table" />
</ElementType>

<ElementType name="Table" sql:relation="Tab_ccsnetevents">
<element type="eventdate" sql:field="eventdate" />
<element type="ReferenceNO" sql:field="ReferenceNO" />
<element type="EventDesciption"
sql:field="EventDesciption" />
<element type="ModuleName" sql:field="ModuleName" />
<element type="ModuleID" sql:field="ModuleID" />
<element type="created_by" sql:field="created_by" />
</ElementType>
</Schema>
*****

Thank you very much.

Nov 12 '05 #1
1 2399
"Rajender" <re*******@hotmail.com> wrote in message news:3b****************************@phx.gbl...
Because of the field eventdate which is dt:datetime in my
xsd file.

******* MY XSD file
<?xml version="1.0" ?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data"

: :

This is not an XSD file -- it is an XDR mapping schema.

If you're using this as the mapping schema for an SQL
Server 2000 Updategram, then you're probably missing
one of the type attributes on the eventdate element that
tells SQL Server 2000 you have an XML Schema ISO
8601 datetime,

<ElementType
name="eventdate"
xs:type="xs:dateTime"
sql2:type="dateTime"
dt:type="DateTime" />

and add the appropriate xmlns declarations to the
Schema element,

<Schema
xmlns="urn:schemas-microsoft-com:xml-data"

xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"
xmlns:sql2="urn:schemas-microsoft-com:mapping-schema"
xmlns:sql="urn:schemas-microsoft-com:xml-sql" >

I'd also refer you to Daniel Cazzulino's solution on SQL XML
(one difference is it employs an XML Schema document as the
mapping schema, not an XDR),

http://www.sqlxml.org/faqs.aspx?faq=67
HTH,

Derek Harmon
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Neil | last post by:
Hi, I hope this question isn't too far off topic....I'm almost at my wits end trying to figure this out. I have a Mysql database and I wish to automate the backup of the database because I...
5
by: gene.ellis | last post by:
Hello everyone, I am really having a lot of trouble understanding the DOM and I doing something quite basic. I need to the DOM (in PHP 5) to modify an XML file. For example the XML basically...
1
by: David Goodyear | last post by:
At the moment im experimenting with ideas in C++ and would really like to solve the following, please please help. Sorry i dont even know what the subject is this would come under? :( Sorry if...
11
by: milkyway | last post by:
Hello, I have an HTML page that I am trying to import 2 .js file (I created) into. These files are: row_functions.js and data_check_functions.js. Whenever I bring the contents of the files into...
4
by: Ron | last post by:
Hi All I've got 2 files, transactions and comments, linked by a clientID as a FK in the clients file and as a FK in the comments file (PK in the 'client' file of course). The comments don't...
3
by: Martin Ho | last post by:
Can someone help me with this please? I wasn't very clear in my old post. I have a program to copy files from one location to another, now I want to copy only those files which were created on...
22
by: KitKat | last post by:
I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6, Cam 7, and Cam 8. Well it does that but it also needs to change the file name to the same folder where the file is being...
2
by: Bill | last post by:
I have a 200 record database that includes a date/time field, AnnivDate, for a wedding anniversary. AnnivDate has nulls and some incorrect year data. I have been creating the Access database...
6
by: shaunb | last post by:
Hi, just new to this forum, and i was wondering if anyone could help me. I've got a piece of work to do, i have done the majority of it, just the last, and the most important thing lol, that i am...
2
by: maxman1 | last post by:
HI Guru, I am newbabe in perl, Could you please help me out. I am having a file withComma (,) seprater data records. Like below 2 lines 01/09/2008...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.