Link to home
Create AccountLog in
Avatar of jdaniels57
jdaniels57Flag for United States of America

asked on

Whitespace error when using sp_makewebtask

I am using the follow store procedure:
sp_makewebtask @outputfile = 'c:\temp\myxmlfile.xml',
      @query = '
select 1 as Tag, Null as Parent,
      PropID AS [listing!1!record_ID!element],
      PropDesc AS [listing!1!title!element],
      AddressL1 AS [listing!1!address!element]
from dbo.qryProperties
order by [listing!1!record_ID!element]
for XML explicit',  
@templatefile = 'c:\temp\template.tpl'

The resulting file has all of the elements listed one after the other:
<listing><record_ID>212</record_ID><title>Towne Loft</title><address>123 Happy Lane</address></Listing>

I have a lagre number of records so it will continue on the same line with the next record and when it gets to the limitation of the txt document it will just continue on the next line including seperating data in the element so when I try and open the xml file I get this error:

Whitespace is not allowed at this location. Error processing resource 'file:///C:/temp/myxmlfile.xml'. Line 4, Position 28

<title>Towne Loft</title><




the template.tpl file is:
<Houses>
<%begindetail%>
<%insert_data_here%>
<%enddetail%>
</Houses>
ASKER CERTIFIED SOLUTION
Avatar of Cedric Obinna A.
Cedric Obinna A.
Flag of Nigeria image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of jdaniels57

ASKER

I was able to find my answer on the web.  Basically what I found out was that sp_makewebtask only works on small record sets and anything longer the 2033 char will wrap to the next line when it gets to 2034, so if it needs to break the line it will do so when it needs to. So i went with another solution.