www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] DOMDocument - Formatting XML output file.

  1. #1
    Join Date
    Jan 2009
    Posts
    16

    resolved [RESOLVED] DOMDocument - Formatting XML output file.

    I'm sure this will have been asked before but I cant find it in the forums - How can I format the output of an XML file that has been created using DOMDocument so that it's tags are nested properly when viewing it in a text editor, By default it just outputs a single line with no breaks... or am I missing something?

    Thanks in advance!

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,936
    See if this works better (I'm just going by some users' notes, I've not tried it):
    PHP Code:
    $domDocObj->formatOutput true;
    $domDocObj->preserveWhitespace false;
    echo 
    $domDocObj->saveXML(); 
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Jan 2009
    Posts
    16
    Spot On mate!! Thanks heaps... I knew it would be something simple.

    Thanks again!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles