1

I'm attempting to use Notepad++ TextFX HTMLTidy -> Tidy: Reindent XML. This works well with the following exception. Lines longer than 70 character are wrapped, breaking the validity of my xml.

This:

<RevieweeDepartmentName>BB AAAAAAAAAA AAAAAAAAAA AAAA</RevieweeDepartmentName>

Becomes this:

    <RevieweeDepartmentName>BB AAAAAAAAAA AAAAAAAAAA
AAAA</RevieweeDepartmentName>

How can I get it to stop this behavior?

3 Answers 3

4

In newer versions of Notepad++, you need to locate the TIDYCFG.INI file in C:\Program Files\Notepad++\plugins\Config\tidy

The INI file has a separate group for each entry on the Tidy menu. A group looks like this:

[TiDy clean Document - nowrap]
bare:no
clean:no

The text in brackets is the group name. This is the text that shows up in the HTML Tidy menu. The lines following are keys and values.

Locate [Tidy: Reindent XML] which is at the bottom of the file.

Add a new key of wrap: Set the value to either 0 (to turn of wrapping) or whatever line width you want. (I use 160.)

You can also move this group around in the file to re-order your menu. I put mine at the top to make it quicker to access.

So the top of my TIDYCFG.INI looks like this:

; quick reference: http://tidy.sourceforge.net/docs/quickref.html 
; cesky preklad:   http://www.pspad.com/cz/tidy.htm
; sample config file for HTML tidy from http://www.w3.org/People/Raggett/tidy/
[Tidy: Reindent XML]
input-xml: yes
indent:yes
wrap: 160

[Sample from Web Page]
...continued...

If you're editing this file from inside of Notepad++, you need to remember save and close NP++, then re-open it for these changes to show up.

0
2

This isn't exactly a solution, but rather a work-around: I use SoapUI to format XML - it works great, and keeps the XML valid. Besides, it's possible that SoapUI may be useful for whaterver you'd like to do with the XML after you format it.

1

Edit the file HTMLTIDY.CFG and change the line:

wrap:70

to

wrap:0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .