• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

XML formatting

Guest
May 31, 2007 May 31, 2007

Copy link to clipboard

Copied

I am updating an XML file. It looks fine when I view it through IE, but when I open it to edit it in Dreamweaver the formatting is terrible. It looks like this:

<RML><Current><Name>Current</Name><Tag>UNAVAILABLE</Tag><LastUpdated>Date</LastUpdated><LastUpdater>Created</LastUpdater><Server>192.168.0.65</Server><ServerBase>d:\LabtestSec</ServerBase><Rev/><FullPath>D:Labtestsec\RML\lts</FullPath></Current></RML>

Instead of:
<RML>
<Current>
<Name>Current</Name>
<Tag>UNAVAILABLE</Tag>
<LastUpdated>Date</LastUpdated>
<LastUpdater>Created</LastUpdater>
<Server>192.168.0.65</Server>
<ServerBase>d:\LabtestSec</ServerBase>
<Rev/>
<FullPath>D:Labtestsec\RML\lts</FullPath>
</Current>
</RML>

How can get it to output with linebreaks in the file?
TOPICS
Advanced techniques

Views

223

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 01, 2007 Jun 01, 2007

Copy link to clipboard

Copied

You could perform a global replace where you use regular expressions to replace:
"(</[a-zA-Z0-9]+>)"

with this:
"\1
"

notice the line break.

Otherwise, you'll have to find some program or online tool that will "prettyprint" your code for you. Not sure about dreamweaver, but what happens if you view source code of your XML in IE?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 01, 2007 Jun 01, 2007

Copy link to clipboard

Copied

LATEST
It looks good through IE -I'll try the global replace - thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation