XML file with embedded content - how to exclude text from translation

I've got an XML structure with nodes like this one:

<p id="260">This document covers the &lt;Model&gt;.</p>

I want the content of the <p> nodes to be translated, except for &lt;Model&gt.

I've set up an XML (Legacy Embedded Content) file type. In the Parser rules, <p> is set as translatable.

In Embedded Content (Legacy), I've set:

- checked Enable embedded content processing

- Document structure information: added a custom type named "Variable"

- tag definition rules: start tag&gt;  end tag &lt;  Tag pair, Not translatable.

Now in my preview, I expect a segment "This document covers the "

Instead, I get "This document covers the <Model>."

So my embedded content isn't being filtered out. I'm doing something wrong, but what?

<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="AuthorIT.xslt"?>
<AuthorIT version="20.3.1.40442" xmlns="http://www.authorit.com/xml/authorit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.authorit.com/xml/authorit AuthorIT.xsd">
	<Objects>
		<Book wordcount="25">
			<Object>
				<Description>Headers and Footers</Description>
				<GUID>9e6905caaefa4b019204e85a0bd8789e</GUID>
				<ID>6116</ID>
				<VariantParentID>4091</VariantParentID>
			</Object>
			<ContentsNodes>
				<Node id="4092"></Node>
				<Node id="4093"></Node>
				<Node id="4094"></Node>
				<Node id="11821"></Node>
			</ContentsNodes>
			<VariableAssignments>
				<VariableAssignment>
					<ID>70</ID>
					<Name>Model_Number</Name>
					<Value>300</Value>
					<ValueObject>0</ValueObject>
					<Style>-1</Style>
					<PublishPrompt>true</PublishPrompt>
					<IsVariantCriteria>false</IsVariantCriteria>
				</VariableAssignment>
			</VariableAssignments>
			<PrintByLine>Art. No.: &lt;Article_Number&gt;</PrintByLine>
			<PrintVersion>&lt;Version&gt;</PrintVersion>
			<WebVersion>&lt;Version&gt;</WebVersion>
		</Book>
		<Topic wordcount="1">
			<Object>
				<Description>Back Page</Description>
				<GUID>390099a7512b4ba79fa2245641714d47</GUID>
				<ID>6205</ID>
				<VariantParentID>4113</VariantParentID>
			</Object>
			<Headings></Headings>
			<RelatedGroups></RelatedGroups>
			<Text>
				<p id="254">&lt;Version&gt;</p>
			</Text>
			<VariableAssignments></VariableAssignments>
			<PrintSuperHeading></PrintSuperHeading>
			<WebTitle></WebTitle>
		</Topic>
	</Objects>
</AuthorIT>
AIT variables test filter.zip

Parents
  • In general, it's nice to provide a sample file, it just helps those who are willing to help...

    I made one up from the information you disclosed:

    Then I created a custom XML file type based on the XML 2 file type. These file types are just easier to set up than the legacy file type, with only some drawbacks.

    All customization is in the parser and embedded content sections of that file type, so it's really a 3 minute job:

    This is how Studio displays the content before I set up the embedded content processing:

    Embedded content screen:

    Rule:

    Result:

    Unless there are more requirements this is a really simple task in Studio and you can find many different ways of tackling it.

    Daniel

  • I've attached a test file to my original post now, sorry about that.
    - I have a number of existing XML filters (based on the XML (Legacy Embedded Content) file type)  I'd like to add this to. These have ~50 parser rules each, so it'd take a while to replace them with new with new filters.

    - I made a new XML 2 filter to try your suggestion. I've set it up the way you indicate, but the Preview still suggests the variables are translatable.

    - It seems to me that the conversion of &lt; and &gt; is optional: this is a setting in Entities->HTML Special. Tried both with and without entity conversion, with both options the Preview still suggests the variables are translatable.

    I suspect part of the trouble is that <Model> isn't an XML element. It's half of a tag pair.

Reply
  • I've attached a test file to my original post now, sorry about that.
    - I have a number of existing XML filters (based on the XML (Legacy Embedded Content) file type)  I'd like to add this to. These have ~50 parser rules each, so it'd take a while to replace them with new with new filters.

    - I made a new XML 2 filter to try your suggestion. I've set it up the way you indicate, but the Preview still suggests the variables are translatable.

    - It seems to me that the conversion of &lt; and &gt; is optional: this is a setting in Entities->HTML Special. Tried both with and without entity conversion, with both options the Preview still suggests the variables are translatable.

    I suspect part of the trouble is that <Model> isn't an XML element. It's half of a tag pair.

Children