|
Home > Archive > MS SQL XML > January 2006 > Error: An invalid character was found in text content.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Error: An invalid character was found in text content.
|
|
| E-Cube 2006-01-10, 11:23 am |
| Hello All,
I am currently importing datarows into a sql 2000 database. when I use my
stored procedure which contains sp_xml_preparedocume
nt... and FROM OPENXML,
I get the error stated above in the subject heading.
In reading other websites I have found that the error above:
An invalid character was found in text content.
You will get this error message if a character in the XML document does not
match the encoding attribute. Normally you will get this error message if
your XML document contains "foreign" characters, and the file was saved with
a single-byte encoding editor like Notepad, and no encoding attribute was
specified.
The actual error is:
Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocume
nt, Line 15
XML parsing error: An Invalid character was found in text content.
Based on what I found on the other webisite, the only foreign character in
my data the È in ARKTX="XXX CRÈME 1x20 KG".
Is there anyway to encode this character so I do not get a parsing error?
Thank you in advance
Eric
| |
|
| I found that I have to place an xml declaration
of
<?xml version="1.0" encoding="ISO-8859-1"?>
in my XML string so the sp_xml_prepared_Docu
ment stored procedure will treat
the data as UTF-8 and not the Database's code page.
"E-Cube" wrote:
> Hello All,
>
> I am currently importing datarows into a sql 2000 database. when I use my
> stored procedure which contains sp_xml_preparedocume
nt... and FROM OPENXML,
>
> I get the error stated above in the subject heading.
>
> In reading other websites I have found that the error above:
>
> An invalid character was found in text content.
>
> You will get this error message if a character in the XML document does not
> match the encoding attribute. Normally you will get this error message if
> your XML document contains "foreign" characters, and the file was saved with
> a single-byte encoding editor like Notepad, and no encoding attribute was
> specified.
>
>
> The actual error is:
> Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocume
nt, Line 15
> XML parsing error: An Invalid character was found in text content.
>
> Based on what I found on the other webisite, the only foreign character in
> my data the È in ARKTX="XXX CRÈME 1x20 KG".
>
> Is there anyway to encode this character so I do not get a parsing error?
>
>
> Thank you in advance
> Eric
>
|
|
|
|
|