July 26, 2005 at 9:00 am
I used SQL 2000 to get data, using a simple select statement. No nesting or groupings needed.
Select FirstName, LastName, City, State
from Addresses
for XML auto
The output was saved very nicely to a file. I can open that file in wordpad.
What do I do with it now? How can I view it as a formatted document, with all the xml codes hidden?
As you can see, I am a total newbie to XML, and need all the help that I can get.
Sara
July 26, 2005 at 11:40 am
Not exactly sure what your asking here.
Are you trying to present this data in a webform?
Just want to look at it without the xml characters? there really is no way to do this, without building something. or feeding the xml into some kind of control on a webpage or application. There are lots of 3rd party xml viewing applications either free, or cheap. XML Spy for example. http://www.altova.com/products_ide.html.
July 28, 2005 at 11:52 am
Thanks for the tip. I downloaded XML Spy from altova and it is a help.
But - I still have a problem outputting XML. My code works fine for up to 10 records. More than that and it is missing chunks of data. It seems that SQL truncates the end of some line(?).
Any ideas?
******************
Here is my SQL code. I output it to a file, and it creates the file that I want.
set nocount on
print '<?xml version="1.0" encoding="UTF-8"?>'
print '<root>'
select top 5 *
from Product
for xml auto, elements
print '</root>'
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply