@vijay-S said in Alt+l+x tag is not adding in macro:
I have a single line big xml. … without downloading TExtFX or XMl tools plugin.
is there any way
Notepad++ does not have any native XML formatting tools built in.
I understand that having XML (or HTML, or any other code) all on a single line with no line breaks can be annoying.
There are two good ways and a bad way to format XML (or any other code), and a fourth way that is really just a lame workaround:
Download a plugin that already handles it, like XML Tools.
You have rejected this without giving a reason, even though this is the best answer to give you
Note: TextFX hasn’t been maintained in years, and thus hasn’t kept up-to-date with modern Notepad++. I wouldn’t recommend that route.
Download a tool unrelated to Notepad++ which will give you an external .exe file which will format your XML for you.
This is better than nothing, but not as convenient as having it in a Notepad++ plugin
@Michael-Vincent has
posted that he uses tidy5 for XML, and runs that (and other code tidy apps) using an NppExec script shared
in another post. Of course, that also involves a plugin, so even though it’s another good suggestion, you are likely to reject it.
Do a poor-man’s “xml tidy”, which just involves splitting at the end > of every XML tag.
FIND = >, REPLACE = >\r\n will put a newline after ever >
This will not do any fancy indenting
If you want fancy indenting, use a tool developed for the job, like the XML Tools plugin or tidy5 or whatever other external tool you want
Workaround: Turn on word-wrap, and Notepad++ will at least visually wrap, so you can change the width of your editor window to decide how many characters will be shown per “line”. Please note that this doesn’t change the underlying XML, so that will still all be one big long line.
Rejecting pre-made and already-debugged solutions will only hurt you and the quality of your work. Thinking that we will re-invent the wheel for you, just because you don’t happen to like a particular brand of tire, could be considered rather selfish. I recommend using suggestion #1 or #2. Good luck.