Word Wrapping XML output making invalid XML

Word Wrapping XML output making invalid XML

Post by David McNai » Fri, 31 Jan 2003 03:20:47



SQL query analyzer is placing a <CR> in the result window
at character 2034.  When you copy the XML and place it
into an XML viewer the output is invalid because of the
<CR>.  If you remove it and place it into an XML viewer
the output is valid and the transformation executes.  I
tried outputing the results to a file and the <CR> are
still inserted.  Any help would be greatly appreciated!!!

 
 
 

Word Wrapping XML output making invalid XML

Post by Amar Nalla [MS » Fri, 31 Jan 2003 04:25:25


Hi David,
   I am not sure if Query Analyzer uses ODBC provider while retrieving
records. If that is the case, then ODBC adds <CR> after 2034 chars if I am
not mistaken. I saw some previous discussions regarding this matter. Also
the query analyzer will trim your output based on the size of the buffer you
have set in the options.
  You should try explicitly using a SQLOLEDB provider through ADO to
retrieve the XML.
   Let me further check this issues further and I will let you know.

Thank you,
Amar Nalla

This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:> SQL query analyzer is placing a <CR> in the result window
> at character 2034.  When you copy the XML and place it
> into an XML viewer the output is invalid because of the
> <CR>.  If you remove it and place it into an XML viewer
> the output is valid and the transformation executes.  I
> tried outputing the results to a file and the <CR> are
> still inserted.  Any help would be greatly appreciated!!!


 
 
 

1. XML returned from XML Auto, Elements is invalid

I have the following SQL statement

  SELECT
    NAME_TXT,
  FROM
    Drivers
  FOR
    XML AUTO, ELEMENTS

part of the data returned is the following:

<NAME_TXT>CARLOS   CAMACHO!             </NAME_TXT>

Subst, Alt+170 on the key pad for the !, as the char gets stripped by
Google's Group posting.

The char ! apparently causes the XML to be invalid. I have more
records with issues this is just the first one. I've seen in the Books
on Line reference to converting the tag/attrib names to make them
valid XML identifiers but nothing for data. I find it very odd that it
comes back from SQL server just fine, but fails to load into the dom.
Only thing I can think of is that SQL server isn't using the DOM  to
load the data but rather just concatenating a string together for the
results.

Why is this char not converted, as it apparently isn't a valid in XML?
Is there anyway to force SQL server to convert this and any others?

Thanks
Wayne

2. Statement too long on delete.

3. XML query node problem: same level root from output xml query

4. Creating a Form with "Folder tab" appearance

5. XML templates: return SP OUTPUT parameter in XML

6. DB case-sensitive

7. Broken XML when running queries with FOR XML AUTO and FOR XML EXPLICIT

8. Can I use case statments with in where statment

9. SQL XML Stored Procedure using XML Explicit Returing XML to ASP Page

10. Word Wrap on Output

11. Max output length 8192 for XML output

12. WISH- output extended proc results output to XML

13. XML wrap question