NativeFileParser, PlaceHolderTag with SegmentationHint.Exclude between two EndTag stop text from being shown in the editor. Bug? (Sdl Trados Studio 2015)

Hi,

I am writing a NativeFileParser to parse a text format with embedded tag within the content.

If the parser happens to Output a PlaceHolderTag in between two EndTags, the rest of the text in the structure is not displayed in the editor, but is present in the sdlxliff file that is generated, and will be passed to the NativeFileWriter when saving the target document, but the translator never gets to actually translate the content.

This only happens if the SegmentationHint is set to Exclude

I created a small plugin that hardcodes the DuringParsing() method to re-create the problem, I attached a zip file containing the VS project.

protected override bool DuringParsing()
{
    /*
        Trying to parse text like:
        [<First><Second>Some text within second tag</Second></PH></First>Some text after the tags]

'[' and ']' are StructureTags, the other tags are all SegmentationHint.Exclude

With this sample, the text "Some text after the tags" is never shown in the editor, despite being in the SDLXLIFF     */     // open structure     Output.StructureTag(PropertiesFactory.CreateStructureTagProperties("["));     // some text     Output.Text(PropertiesFactory.CreateTextProperties("Some text before tags"));     // open first tag     IStartTagProperties firstStartTag = PropertiesFactory.CreateStartTagProperties("<First>");     firstStartTag.SegmentationHint = SegmentationHint.Exclude;     firstStartTag.DisplayText = "F";     Output.InlineStartTag(firstStartTag);     // open second tag     IStartTagProperties secondStartTag = PropertiesFactory.CreateStartTagProperties("<Second>");     secondStartTag.SegmentationHint = SegmentationHint.Exclude;     secondStartTag.DisplayText = "S";     Output.InlineStartTag(secondStartTag);     // write some text     Output.Text(PropertiesFactory.CreateTextProperties("Some text within second tag"));     // close second tag     IEndTagProperties secondEndTag = PropertiesFactory.CreateEndTagProperties("</Second>");     secondEndTag.DisplayText = "S";     Output.InlineEndTag(secondEndTag);     // insert a placeholder     IPlaceholderTagProperties phTag = PropertiesFactory.CreatePlaceholderTagProperties("</PH>");     phTag.SegmentationHint = SegmentationHint.Exclude;     phTag.DisplayText = "PH";     Output.InlinePlaceholderTag(phTag);     // close first tag     IEndTagProperties firstEndTag = PropertiesFactory.CreateEndTagProperties("</First>");     firstEndTag.DisplayText = "F";     Output.InlineEndTag(firstEndTag);     // more text --> this wont show up in the editor     Output.Text(PropertiesFactory.CreateTextProperties("Some text after the tags"));     // close structure     Output.StructureTag(PropertiesFactory.CreateStructureTagProperties("]"));     return false; }

 

Demo.zip