0 Replies Latest reply on Jul 27, 2016 5:55 AM by aliceell

    Maintain text wrap/line breaks after XML import

    aliceell Level 1

      I have a text box in InDesign CS6. It reads All Crashes <line break> By Day of the Week.

      allcrashes.png

      However, when I try to import an XML document that contains the same text (in order to update the data in the table below), the line break doesn't appear:

      allcrashes2.png

      Then I have to manually include a line break by pressing Enter in the text frame to make the text wrap the way I want it, which is very slow when I have to do it with multiple text frames.

       

      Here's what the XML looks like:

       

      <Table>

                  <Table_title>all crashes by day of the week</Table_title>

                  <Table ns0:table="table" ns0:tcols="7" ns0:trows="2">

                      <Header ns0:ccols="1" ns0:ccolwidth="32.000000000000014" ns0:crows="1" ns0:table="cell">MON</Header>

                      <Header ns0:ccols="1" ns0:ccolwidth="32.000000000000014" ns0:crows="1" ns0:table="cell">TUES</Header>

                      <Header ns0:ccols="1" ns0:ccolwidth="32.000000000000014" ns0:crows="1" ns0:table="cell">WED</Header>

                      .....

                      <Cell ns0:ccols="1" ns0:ccolwidth="32.000000000000014" ns0:crows="1" ns0:table="cell">43061</Cell>

                      <Cell ns0:ccols="1" ns0:ccolwidth="32.000000000000014" ns0:crows="1" ns0:table="cell">44588</Cell>

                      <Cell ns0:ccols="1" ns0:ccolwidth="32.000000000000014" ns0:crows="1" ns0:table="cell">46205</Cell>

                      .....

                  </Table>

      </Table>

       

      I get the XML by using the Export XML function in Indesign for the original document (the first photo), running a script to update the data in the Cell tags, and then re-importing the XML.

       

      Is there a way to set up the original document so that the line break is maintained when I export the XML? I can't get it to do this. I've tried a couple things:

       

      1. Clicking 'Remap Break, Whitespace, and Special Characters'. But then the carriage return doesn't appear in the XML (as you see in the above example). When I don't enable the remap option, the XML appears as <Table_title>all CRASHES
BY day of the week</Table_title>. As you can see, it doesn't re-map the line break correctly.

       

      2. Highlighting the "By Day of Week" text, and enabling the "No Line Break" option in the Character panel menu. But when I import the XML, it completely ignores the No Line Break option and screws up the formatting anyway.