-
ASP's XML output problem
I'm using ASP to build XML files on my server... but the output is as follows:
Code:
<xml version='1.0'><root><child1 /><child2 /></root>
instead of an indented version that I'd prefer, ie:
xml
root
child1
child2
/root
(With the begining and ending tags of course, I'm just doing this so you know what I mean)
Any ideas on how to get it to output that way? Thanks
Last edited by Metalguy211; 08-27-2003 at 12:12 AM.
-
Senior Member
In ASP are you hand creating the XML or are using the MSXML object?
Thanks
Luke
-
msxml object
its driving me nuts, my whole project would be finished if it weren't for that damn complication.
thanks
-
Hi Metalguy211,
As far as I'm aware, MSXML doesn't have any support for saving "pretty XML", you're limited to doing it yourself.
First off, why do you want indented XML? IE can display it nicely for you if it's purely for display purposes, and there's lots of free editing tools that can edit it.
Anyway, assuming that you have to have it looking pretty for Notepad, one way to do it is to have an XSLT which has output mode set to "text", and to indent like that... it will require a bit of recursion, to do it cleanly but it should work.
Another option is to write a recursive function that outputs the XML, also pretty easy.
Did you want help with either of those options?
Tim Walters
Senior Developer
XML Evangelist
"XML isn't a language, it's a way of life!"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|