Formatting xml files

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
tshad
Posts: 13
Joined: Sun Jan 06, 2008 6:33 am

Formatting xml files

Post by tshad »

I have xml files I would like open and edit in textpad.

But the files are always in one line.

Is there a way to have textpad reformat the xml file to indent it properly?

Thanks,

Tom
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

Perhaps you need to run the file through something like HTML Tidy. You can get it as a TextPad add-on or as a standalone program.
tshad
Posts: 13
Joined: Sun Jan 06, 2008 6:33 am

Post by tshad »

It seems to want to create an html file and not handle the xml data.

I tried using the preferences (with and without quotes where with quotes seemed to work better).

The file I am trying to handle has one line in it:

<?xml version="1.0"?><DTSConfiguration><DTSConfigurationHeading><DTSConfigurationFileInfo GeneratedBy="SATELLITE\jcd" GeneratedFromPackageName="Lesson 3" GeneratedFromPackageID="{FF720C4A-6E57-4AA8-B20B-0D7E9DE96B52}" GeneratedDate="1/23/2011 11:02:29 PM"/></DTSConfigurationHeading><Configuration ConfiguredType="Property" Path="\Package.Variables[User::varFolderName].Properties[Value]" ValueType="String"><ConfiguredValue>C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Tutorial\Creating a Simple ETL Package\Sample Data</ConfiguredValue></Configuration></DTSConfiguration>

The results I get are:

line 1 column 22 - Error: <dtsconfiguration> is not recognized!

line 1 column 22 - Warning: missing <!DOCTYPE> declaration

line 1 column 22 - Warning: discarding unexpected <dtsconfiguration>

line 1 column 40 - Error: <dtsconfigurationheading> is not recognized!

line 1 column 40 - Warning: discarding unexpected <dtsconfigurationheading>

line 1 column 65 - Error: <dtsconfigurationfileinfo> is not recognized!

line 1 column 65 - Warning: discarding unexpected <dtsconfigurationfileinfo>

line 1 column 258 - Warning: discarding unexpected </dtsconfigurationheading>

line 1 column 284 - Error: <configuration> is not recognized!

line 1 column 284 - Warning: discarding unexpected <configuration>

line 1 column 409 - Error: <configuredvalue> is not recognized!

line 1 column 409 - Warning: discarding unexpected <configuredvalue>

line 1 column 426 - Warning: plain text isn't allowed in <head> elements

line 1 column 22 - Info: <head> previously mentioned

line 1 column 426 - Warning: inserting implicit <body>

line 1 column 547 - Warning: discarding unexpected </configuredvalue>

line 1 column 565 - Warning: discarding unexpected </configuration>

line 1 column 581 - Warning: discarding unexpected </dtsconfiguration>

line 1 column 22 - Warning: inserting missing 'title' element


Tool completed with exit code 2

Thanks,

Tom
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Did you try entering
tidy -help
?

Code: Select all

Options for HTML Tidy for Windows ...
...
 -xml                specify the input is well formed XML
...
Post Reply