0

Reminder: I dont have any experience on with this code at all.

Im working on an XML File/Code with Notepad ++, this will be the code im working on:

<TextObject Name="CmnaOrigen" Left="6.5" Height="1.5" Top="3.2" Width="6.0"> 
<Text>Av. El Bosque Norte 500 - Of. 1102 Las Condes - Santiago - Chile Tel: (56-2) 2362 2200 - Fax: (56-2) 2362 2496 </Text> 
<Color R="0" Name="Black" G="0" B="0" A="255"/> 
<Font Name="Arial" SizeInPoints="8" Italic="false" Bold="False"/> 
<Border> <BackgroundColor Name="White" R="255" G="255" B="255" A="255"/> </Border> 
<ObjectFormat HorizontalAlignment="LeftAlign" EnableSuppress="false"/> 
</TextObject>

What im trying to do is to break the lines in the text so they look like this:

Av. El Bosque Norte 500 - Of. 1102
Las Condes - Santiago - Chile
Tel: (56-2) 2362 2200 - Fax: (56-2) 2362 2496

I already tried the <br /> /n <line></line> tags from other questions and nothing is working, i did figure out a way of making it work because of the width, i can put many spaces until the lines move and look just like it, but i know there must be a proper solution for this small issue and i would love to learn it.

Thank you.

Dorian S.
  • 1
  • 1
  • The `/n` or the `\n` ? – T00rk Sep 10 '14 at 17:46
  • both and is not working – Dorian S. Sep 10 '14 at 17:55
  • http://stackoverflow.com/questions/10917555/adding-a-new-line-break-tag-in-xml – ltotally Sep 10 '14 at 18:23
  • This is what i did, and now the CDATA tag is making the
    tag appeaar in the text, also forgot to say that this is XML code that is being transform? or made into a PDF. <![CDATA[Camino Lo Ruiz 5310, Galpón B - Quilicura, Santiago Teléfono: 2495-8557
    La Martina 400 - Pudahuel, Santiago
    Teléfono: 2389-1200 ]]>
    – Dorian S. Sep 10 '14 at 19:35

1 Answers1

0

A special attribute named xml:space may be attached to an element to signal an intention that in that element, white space should be preserved by applications; the value "preserve" indicates the intent that applications preserve all the white space.

Alternatively you can add a CDATA section.

In general XML tags express semantics. If the XML schema/DTD that you are using does not allow a br or line tag within Text, then the semantics of the Text tag is just a string of text, and not a set of lines.

  • Sorry, like i said at the beginning of the question, i dont know anything about this, i already added the CDATA tag and still not working i dont know what im doing wrong. – Dorian S. Sep 10 '14 at 19:43