Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Include carriage returns in XML export

Community Beginner ,
Oct 27, 2017 Oct 27, 2017

I'm a software developer working on an InDesign-to-web integration for a publishing company.

The first step of the integration is to tag the contents of an .indd file, then export the tagged structure as XML. Each column (or flowing columns) of text is tagged as a paragraph. For example, an article with 3 columns of flowing text is tagged as a "paragraph". Inside of a column tagged as "paragraph", there are multiple groupings of text.

In the screenshot below, the blue outline represents the element tagged as "paragraph". The yellow highlights represent where one group of text ends and the next begins.

boca_indesign_2.PNG

When I export the tagged content, I need to include line breaks (denoted by the yellow highlight) so I can properly distinguish one group of text from another as I translate it into HTML code. Currently, the export doesn't include line breaks, so the text is converted to the web as a single blob of text.

In the screenshot below, the red lines represent where one group of text ends and the next begins. Ideally, the export would include a new line character in that position.

boca_indesign_3.PNG

Is it possible to add a carriage return/line break character between each block of text?

Notes

I understand a HTML export exists, but we chose to go with the XML export instead for many reasons:

  1. Control over the order of placement of text & image content.

  2. Ability to add meta data about the article content (categories, tags, author/editor, etc.)
  3. Absolute control over the HTML structure created as the content is migrated to the web.
  4. Easier to store or migrate to other data sources
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Oct 27, 2017 Oct 27, 2017

Hi,

A true surprise to me but indeed if you tag a story (or its container by extension), the carriage returns won't appear in the exported XML ! Once that said, your options aren't that numerous. Either you tag paragraph themselves (you can later remove the extra tags with XSLY on export if needed) or add a tag (think of a dummy <br/>) at the end of every single paragraph.

Unless I am wrong…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 27, 2017 Oct 27, 2017

That is consistent with what I've found. Unfortunately, it would be difficult to convince the designers to tag every individual paragraph for every magazine. It becomes more difficult when considering text content which flows across multiple columns (paragraphs split between pages).

It seems only hard-tab characters will appear in the XML document.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Oct 27, 2017 Oct 27, 2017
LATEST

MParsons095  a écrit

it would be difficult to convince the designers to tag every individual paragraph for every magazine

They don't have to. They can either map styles to tag (see tags panel flyout menu); that consists in asking inDesign to autotag any contents where the style is applied (but yes, it has to be done for every single paragraph style applied).

Or you can create  a startup script based on beforeExport event so you would add br tags on the fly, do export, remove br tags.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines