I'm importing XML into InDesign (with merge content mode) and using XSLT to pick specific XML elements from the XML file. Problem is that some of the text inside XML elements contain HTML entities (see the example below) which are converted as characters in Indesign and then show as HTML tags. I need to set correct character style for the text between HTML tags and remove the tags. I'm aware I can do this with GREP Find/Replace in InDesign after the XML import but is there a way I can do this already with XSLT? I'm guessing I should convert these HTML tags into XML elements so I can map character style to correct XML element in InDesign. Not sure if this is possible and how to do it. Or is there some other better way?
XML:
<TextElement>Just some random text with <b>HTML tags</b> within.</TextElement>
Text in InDesign:
Just some random text with <b>HTML tags</b> within.
<b>HTML tags</b>
is already an XML element. Perhaps you want to change it into a different XML element? You can certainly add amatch="b"
template rule to your XSLT to process it -- so long as you know what you want to do with it!<
and>
in the text and when the XML is imported into InDesign, these entities are converted as<
and>
so there will be e.g.<b>text</b>