July 15, 2008 at 1:09 pm
Hi guys,
I need help.
I need to update table from xml and I am getting error :'
Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocument, Line 114
XML parsing error: Invalid at the top level of the document.'
DECLARE @SOAPMessage varchar(8000), @i int
"SET @SOAPMessage =
'
EXEC sp_xml_preparedocument @i output, @SOAPMessage
SELECT *
FROM OPENXML(@i,'/returnstatus/responseaccountvalidate1/',2)
WITH ( token varchar(100)-- sessionIdvarchar(40)
, codeinteger
, externalId varchar(30)--'externalId[@xsi:nil!="true" or not(@xsi:nil)]'
, status char(1)--'status[@xsi:nil!="true" or not(@xsi:nil)]'
--, playerLimitmoney'playerLimit[@xsi:nil!="true" or not(@xsi:nil)]'
, nicknamevarchar(9)--'nickname[@xsi:nil!="true" or not(@xsi:nil)]'
, maxTransferbit--'maxTransfer[@xsi:nil!="true" or not(@xsi:nil)]'
, casinoVipFlagbit--'casinoVipFlag[@xsi:nil!="true" or not(@xsi:nil)]'
, nicknameChangebit--'nicknameChange[@xsi:nil!="true" or not(@xsi:nil)]'
--, urlvarchar(255) --'url[@xsi:nil!="true" or not(@xsi:nil)]'
, messagevarchar(256)--'responseMessage[@xsi:nil!="true" or not(@xsi:nil)]'
exec sp_xml_removedocument @i
) T
Whats wrong?!
Please help I'm on dead line.
Thanks in advance
I have no idea why it is not copy XML .I added it as attachment
'
July 15, 2008 at 1:48 pm
The removedocument is out of order, but that was the only issue I found. I'm guessing that there is a bad character in the XML that didn't survive the cut-n-paste to the newsgroup and that is causing the issue. I don't have much experience here though, so I'm kind of guessing.
I've attached the order that I ran your script with ... to show where I've clipped out the long pieces.
DECLARE @SOAPMessage varchar(8000), @i int
SET @SOAPMessage = '<?xml ...
...soapenv:Envelope>'
EXEC sp_xml_preparedocument @i output, @SOAPMessage
SELECT *
FROM OPENXML(@i,'/returnstatus/responseaccountvalidate1/',2)
WITH ( token ...
, message varchar(256) --'responseMessage[@xsi:nil!="true" or not(@xsi:nil)]'
)T
exec sp_xml_removedocument @i
July 15, 2008 at 2:05 pm
I'll commit suicide
July 15, 2008 at 2:59 pm
I am a novice in XML, but copied your attached file to a drive and then independent of Internet Explorer open it using notepad. It appears not to be what is termed "Well formed". For understanding what that is may I suggest this URL http://www.javacommerce.com/displaypage.jsp?name=wellform.sql&id=18238 for a rather simple explanation with many examples of well formed or not well formed. This might give you a clue as to what editing you will have to perform. The original file has as its last character a single quote mark '
I then removed the ' (single quote) as the last character of text, saved the resulting file with a dot XML extension and I was then able to open it using internet explorer. When opening the file internet explorer warned me that the file wanted to run an Active X control on my machine. I would not allow that so this is as far as I was willing to go. Hope this helps.
July 15, 2008 at 7:50 pm
Thank you,
I'll try
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy