Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 XML Parsing Error(Urgent)

Author  Topic 

manish_joisar
Starting Member

1 Post

Posted - 2005-06-27 : 03:17:50
Following is the XML that i pass to SP
When i Call Sp_Xml_PrepareDocument it give error as
XML parsing error: Whitespace is not allowed at this location.

But when i remove '&' from (MOVE IN & OUT) and put there 'and'
it is working fine

So what to do
'<project projectno="1">
<generalcondtion tgc_no="11" tgc_generalcondtionno="8" unitcode="" tgc_unitprice="4100" tgc_quantity="1" tgc_amount="4100" tgc_desc="GENERAL LIABILITY INSURANCE" tgc_comments="" />
<generalcondtion tgc_no="1" tgc_generalcondtionno="10" unitcode="" tgc_unitprice="45" tgc_quantity="80" tgc_amount="3600" tgc_desc="MOVE IN & OUT" tgc_comments="" />
</project>'

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2005-07-05 : 18:12:53
Hi
The ampersand character has special meaning in XML. If you want to use it literally, you must 'escape' it by using the entity reference '&amp;'.
You can use the REPLACE function to do this as follows:
SET @MyXML = REPLACE(@MyXML, '&', '&amp;')
Just a minor point, but that typo in what I'm assuming should be your <generalcondition> entity will probably be a pain later on if left unchecked!

Mark
Go to Top of Page
   

- Advertisement -