Mobile app version of vmapp.org
Login or Join
Cooney243

: Include assignments when exporting XML from InDesign When exporting XML from InDesign, I'd like assignments to show up as parent elements without manual intervention. What I get now for a page

@Cooney243

Posted in: #AdobeIndesign #Export #Xml

When exporting XML from InDesign, I'd like assignments to show up as parent elements without manual intervention.

What I get now for a page that has three stories in two assignments:

<Root>
<Story>
<Headline>Foo</Headline>
<Body>Bar</Body>
</Story>
<Story>
<Headline>Foo2</Headline>
<Body>Bar2</Body>
</Story>
<Story>
<Headline>Foo3</Headline>
<Body>Bar3</Body>
</Story>
</Root>


What I'd like to get:

<Root>
<Assignment>
<Story>
<Headline>Foo</Headline>
<Body>Bar</Body>
</Story>
<Story>
<Headline>Foo2</Headline>
<Body>Bar2</Body>
</Story>
</Assignment>
<Assignment>
<Story>
<Headline>Foo3</Headline>
<Body>Bar3</Body>
</Story>
</Assignment>
</Root>

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Cooney243

1 Comments

Sorted by latest first Latest Oldest Best

 

@Holmes874

Use this xsl on export

<?xml version="1.0" encoding="UTF-8"?>




<xsl:template match="/">
<xsl:apply-templates select="*"/>
</xsl:template>

<xsl:template match="Story">
<Assignment>
<xsl:copy-of select="."></xsl:copy-of>
</Assignment>
</xsl:template>

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme