A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: ASP's XML output problem

  1. #1
    Member
    Join Date
    Jun 2002
    Posts
    41

    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.

  2. #2
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    In ASP are you hand creating the XML or are using the MSXML object?

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  3. #3
    Member
    Join Date
    Jun 2002
    Posts
    41
    msxml object

    its driving me nuts, my whole project would be finished if it weren't for that damn complication.

    thanks

  4. #4
    Member
    Join Date
    Jan 2003
    Location
    Australia, Adelaide (SA)
    Posts
    97
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center