0

Is it possible to apply a bold italic character style to a tag in adobe indesign. Currently you can create a character style e.g. 'strong' and map this style to a tag, so when you import an xml, the 'strong' character style will apply to any 'strong' tags.

However, if you were to create a new character style e.g. bold italic, how could you apply it to a tag? At the moment, if you were to import the following

<strong><em>I like cake!</em></strong>

and you had character styles defined for strong and em, only the em character style will be applied as the xml tree node looks like:

enter image description here

Is it possible to apply a bold italic character style to <strong><em> so it doesnt come out in just italics?

Matt Sleeman
  • 135
  • 7
  • This is a similar letdown as to *exporting*. Try a simple XSLT that transforms (properly nested) pairs into a single XML code. You probably need to work out what should happen with `wot now?` nodes as well. – Jongware May 12 '15 at 19:35

1 Answers1

1

The following will give you an "emstrong" tag for em nested inside strong or vice versa.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">

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

    <xsl:template match="em[../../strong]|strong[../../em]">
        <xsl:element name="emstrong">
            <xsl:apply-templates/>
        </xsl:element>
    </xsl:template>

</xsl:stylesheet>
user1754036
  • 396
  • 1
  • 6