|
Home > Archive > MS SQL XML > January 2006 > How to debug "sp_xml_preparedocument" stored procedure
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 |
How to debug "sp_xml_preparedocument" stored procedure
|
|
| Goran Djuranovic 2006-01-31, 1:24 pm |
| Hi All,
I am getting "XML parsing error: A name was started with an invalid character." error returned from " sp_xml_preparedocume
nt". The XML text I am passing to the stored procedure is well-formatted in VS.NET, so I don't see a reason why text should be the problem (which the error message suggests).
Anyway, I would like to either get more descriptive error such as: line it failed on and element it failed on. Or, I would like to debug the " sp_xml_preparedocume
nt" stored procedure through QA, if possible. How do I do any of this?
Thanks for your response.
Goran Djuranovic
| |
| Galex Yen [MSFT] 2006-01-31, 8:25 pm |
| Goran,
Thank you for your feedback. In SQL Server 2005, more information is
provided in the addition to the error. The error one would get for this
example:
declare @h int
exec sp_xml_preparedocume
nt @h output, '
<&foo>
foo
</&foo>'
is:
The XML parse error 0xc00ce504 occurred on line number 2, near the XML text
"<&foo>".
Msg 6602, Level 16, State 2, Procedure sp_xml_preparedocume
nt, Line 1
The error description is 'A name was started with an invalid character.'.
Regards,
Galex Yen
"Goran Djuranovic" wrote:
> Hi All,
> I am getting "XML parsing error: A name was started with an invalid character." error returned from " sp_xml_preparedocume
nt". The XML text I am passing to the stored procedure is well-formatted in VS.NET, so I don't see a reason why text should be the p
roblem (which the error message suggests).
>
> Anyway, I would like to either get more descriptive error such as: line it failed on and element it failed on. Or, I would like to debug the " sp_xml_preparedocume
nt" stored procedure through QA, if possible. How do I do any of this?
>
> Thanks for your response.
>
> Goran Djuranovic
| |
| Goran Djuranovic 2006-01-31, 8:25 pm |
|
"Galex Yen [MSFT]" <galexy@online.microsoft.com> wrote in message
news:EBF56025-1EFC-48BD-9F0D- 6AA9658D1588@microso
ft.com...
> Goran,
>
> Thank you for your feedback. In SQL Server 2005, more information is
> provided in the addition to the error. The error one would get for this
> example:
>
> declare @h int
> exec sp_xml_preparedocume
nt @h output, '
> <&foo>
> foo
> </&foo>'
>
> is:
>
> The XML parse error 0xc00ce504 occurred on line number 2, near the XML
> text
> "<&foo>".
> Msg 6602, Level 16, State 2, Procedure sp_xml_preparedocume
nt, Line 1
> The error description is 'A name was started with an invalid character.'.
>
> Regards,
> Galex Yen
Thanks, but how do I do it in SQL 2000 ???
Goran Djuranovic
| |
| Galex Yen [MSFT] 2006-01-31, 8:25 pm |
| Goran,
We do not have additional information for SQL Server 2000. I have two
recommendations.
1) Remove sections of the xml document one at a time to determine where you
are getting the parse error and look at that xml to make sure it is in fact
valid.
2) Make sure that encodings match. If you are using an xml document that
comes from a UTF-16 source, make sure that the parameter passed to
sp_xml_preparedocume
nt is nchar, nvarchar or ntext. (If you are using a
literal string, place N in front of string ie N'foo')
If you are unable to resolve your issue using the above suggestions, please
send me your xml via email (remove ".online" from my address) and I will help
you with resolving the problem.
Regards,
Galex Yen
"Goran Djuranovic" wrote:
>
> "Galex Yen [MSFT]" <galexy@online.microsoft.com> wrote in message
> news:EBF56025-1EFC-48BD-9F0D- 6AA9658D1588@microso
ft.com...
>
> Thanks, but how do I do it in SQL 2000 ???
>
> Goran Djuranovic
>
>
>
|
|
|
|
|