0

I am trying to use out writer in Java to create a XML file, but the generated XML File is in one line, which is very difficult to read and debug. I tried using backward-slash-n but the reader which I am using does not recognizes backward-slash-n so I need some alternative to break or backward-slash-n to add a line break to make it more readable and debug easily.

What should i do?

And also in notepad is there a way to add linebreaks using replace keyword for e.g., Search for > and replace with > + {Enter Key} i.e., line-break after every tag

D3X
  • 547
  • 3
  • 20

2 Answers2

1

In notepad++, you can search for

>

and replace with

>\r\n

just click the "Extended" search mode

Joel M. Lamsen
  • 7,143
  • 1
  • 12
  • 14
0

Depending on how you do it, the text might be escaped twice. Try replacing \n with \\n.

As for the notepad part of the question I am very sure that it is not possible. I recommend Notepad++ (http://notepad-plus-plus.org). It supports this and many other functionalities, such as macros, converting between encodings, search/replace by regexp etc.

LoPoBo
  • 1,767
  • 1
  • 15
  • 26