3 Replies Latest reply on Nov 28, 2016 10:10 AM by cfang

    Preserve newlines in the property value

    richardmoore

      Is there a way to preserve the newlines in the property value attribute?

        • 1. Re: Preserve newlines in the property value
          cfang

          is it for batch property values in job xml files?  I think if your property value has new lines, it will be read in as is by JBeret.  So you just need to use the appropriate xml entities to escape it.

           

          Can you give more details/examples of what is working, what is not working?

          • 2. Re: Preserve newlines in the property value
            richardmoore

            Here is what I am trying to use but is being read in as one record -

             

            <property name="sorting" value="

              10, 30, STRING

              50, 10, STRING, A

              40, 10, STRING

              "/>

             

            I didn't realize that I would have to escape the newlines.

            • 3. Re: Preserve newlines in the property value
              cfang

              I tried the following property, and the new line is properly preserved:

               

              <property name="string" value=" a b c&#10;
                X Y Z in a new line"/>

               

              Field injection: class java.lang.StringBuilder stringBuilder = a b c
                                                               X Y Z in a new line;

               

              I think the same is for blank spaces, and you will also need to escape them.  They are both colasced by the xml parser.