Microsoft KB Archive/279430

= PRB: sp_xml_preparedocument Stored Procedure Fails with Error 6603 =

Article ID: 279430

Article Last Modified on 10/3/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q279430



SYMPTOMS
When you invoke the sp_xml_preparedocument stored procedure, the call fails with this error message:

Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocument, Line 19 XML parsing error: A string literal was expected, but no opening quote character was found.



CAUSE
The sp_xml_preparedocument stored procedure was given an invalid XML document to process.



RESOLUTION
Correct the XML document passed into the sp_xml_preparedocument stored procedure for processing.



STATUS
The behavior is by design.



MORE INFORMATION
Users have requested that the program have the ability to provide the location within the XML document in which the error is located. Currently, this functionality does not exist. However, here is way you can determine where the error is occurring in your XML document:
 * 1) Save the XML document in a text file with an extension of .xml.
 * 2) Load that .xml document into Microsoft Internet Explorer 4.01 by browsing to the .xml file.

Steps to Reproduce Behavior
  Paste the following code into the SQL Server Query Analyzer, and then run the code: declare @hdoc int declare @doc varchar(1000) set @doc ='          <Order_0020_Details OrderID=&quot;10283&quot; ProductID=&quot;72&quot; Quantity=&quot;3&quot;/> </Orders> </Customers> </ROOT>' --Create an internal representation of the XML document. exec sp_xml_preparedocument @hdoc OUTPUT, @doc exec sp_xml_removedocument @hDoc

This error message displays:

Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocument, Line 19 XML parsing error: A string literal was expected, but no opening quote character was found.

</li> <li>Using the code in step 1, copy from the <ROOT> element to the </ROOT> element.</li> <li>Paste, and then save the text you copied from the XML document into a text file with an .xml extension.</li> <li>Open the .xml file you just saved by browsing the file with Internet Explorer. This error message occurs:

A string literal was expected, but no opening quote character was found.

Line 2, Position 43

<Customers CustomerID=&quot;VINET&quot; ContactName=123>

--^

</li></ol>

Keywords: kbprb KB279430

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.