Paste XML as formatted string in IntelliJ

Answered

Hi , 

 

I have a large XML. I want to paste it into IntelliJ in this format. How should i do it ?

 

Example  XML 

 

<note>
    <to>Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
     <body>Don't forget me this weekend!</body>
</note>

 

When Pasted in IntelliJ

 

"<note> " +
"    <to>Tove</to>" +
"    <from>Jani</from> " +
"    <heading>Reminder</heading>"+
"     <body>Don't forget me this weekend!</body>"+
"</note>"
 
Is there any shortcut way of doing it rather than manually doing it ?
Basically i need it as string but also, not in one line . I need it with those XML indentations .

 

 

 

0
3 comments

Hi. Using Edit | Paste simple will paste the line as it is.

0
Avatar
Permanently deleted user

yes , it pastes but please notice I want them all in a string . Please look at the example above.

0

Just paste inside the quotes:

0

Please sign in to leave a comment.