October 7, 2005 at 5:37 am
DECLARE @StrXml varchar(8000)
SET @StrXml = <employee name='jon''s dicosta & Co' />
DECLARe @Idoc int
EXEC Sp_Xml_PrepareDocument @idoc OUTPUT, @StrXml
Gives error as
XML Parsing Error
If i Remove Single quote / & then this error is not coming
Sql Server 2000
Product Version - 8.00.760 (Sp3)
Waiting for your reply
Thanks in advance
October 7, 2005 at 8:50 am
Hello,
the problem your having is Ur xml is no good
when you set @strXML, you need to use an apostorphe (')
with an attribute in an xml string the Value is wrapped in Quotes (")
and the special characters in your string will screw up the parsing.
Please change your string as I have shown below.
set quoted_identifier on
DECLARE @StrXml varchar(8000)
DECLARe @Idoc int
SET @StrXml = '<employee name="jon's dicosta & Co"/>'
EXEC Sp_Xml_PrepareDocument @idoc OUTPUT, @StrXml
exec sp_xml_Removedocument @idoc
October 9, 2005 at 10:28 pm
It worked
Thanks for your reply
Can you give me list of other special charatcers with its value ?
Waiting for your reply
Thanks
March 14, 2006 at 3:00 am
It is Very urgent
If i write something in Word File & Insert Bullet Also
& if i copied that in TextBox, user click on SAVE link
I am passing XML to SP
It gives error
XML parsing error: An invalid character was found in text content
'· Manish'
. is actual Bullet
now how can i solve this problem & what to do if User Paste any Character b/w 0 - 255
Thanks in Advance
March 19, 2006 at 9:33 pm
I got solution
instead of setting Parameter as TEXT Datatype for XML Parameter in Stored Procedure, we have changed it to NTEXT & it worked
TEXT datatype doesn't support Special Character while parsing with SP_XML_PREPAREDOCUMENT
March 21, 2008 at 12:04 pm
it did not worked for me. I have datatype as varchar(8000) and sending XML data as follows:
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply