Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML split attribute value on multiple line

I have XML data which contains a long attribute value. The value does not contain white space characters. I want to format the XML for readability by splitting the XML text so that the line does not exceed a maximum number of column.
Is there any mean to accomplish this? Is there any break character that I can put at each end of line so that the XML parser does not consider it as a white space (like underscore character in visual basic)?

For example:

<element attribute="this_is_a_very_long_text_attribute_value_that_I_want_to_split_on multiple_line_for_readability"/>

I want to have something like:

<element attribute="this_is_a_very_long
_text_attribute_value_that_I_want_to_split
_on multiple_line_for_readability"/>
like image 772
Gaël Mo Avatar asked Jul 09 '12 10:07

Gaël Mo


1 Answers

there is no provision in XML itself for line feed character in Attribute Values
however this can be done depending upon the IDE you are using this to write
ie. if you are using Visual Studio there is a provision to break lines and is handled by the IDE itself
but if you are using some low level text editor like Notepad this cant be done
you should probably check in the documentation of your XML editor

like image 184
Parv Sharma Avatar answered Oct 21 '22 13:10

Parv Sharma