Search code examples
xmltaggingadobe-indesign

How to tag an inDesign document so that tagged content is in between other tags?


It is easy to tag a single piece of content and then export it as xml in inDesign.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <Root><content>Simple text block</content></Root>

What I'm struggling to do is to get it to export tags / content within another set of tags. Example: I want to tag my document so that it exports as so:

<?xml version='1.0' encoding='UTF-8'?>
<article>
  <id>123</id>
  <content>
    <body>Some text</body>
    <headline>Some other text</headline>
  </content>
</article>

Here is what I tried: enter image description here

When I exported the xml I got the following:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<article>
    <content>Simple text block</content>
    <id>123</id>
    <content></content>
    <body>Some text</body>
    <headline>Some other text</headline>
</article>

How do I tag the elements so that it export tags / content within another set of tags?


Solution

  • I think you need to use Structure Panel (View->Structure->Show Structure).

    Rename root to "article" add id and content tags and add body and headline to content tags.

    Tag you layout objects and try to export xml.