Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

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.

share|improve this answer

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.

share|improve this answer

Edit the file HTMLTIDY.CFG and change the line:

wrap:70

to

wrap:0
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.