Is it possible to mark attributes at non-translatable using XPath?

If I have the following XML tag:

<Property ID="MaxNumberOfFiles" DataType="UINT" Value="1" Name-en="Maximum number of files" Description-en="This value defines the number of .csv files that are generated after a 'Record' command. The 'RecordDone' output is set to TRUE when the files have been created" ValueRange="1-65535" />

And only need to translate the text under attribute "Description-en", is it possible to extract all of the other attributes for display in the Trados Studio 2019 editor for "informational purposes" (text is present but locked). I know this is possible with tag elements themselves (inline / non-translatable / Include), but I can't seem to get it to work with attributes. Also tried with embedded content but to no avail.

Anyone know if this is possible?

Parents
  • Thanks again for the replies! I like the DSI app solution because it works out of the box and provides information "on the fly",  i.e. the screen is updated when moving along units, which is nice.

    I would have also liked to try out the stylesheet solution from Paul, but I am a stylesheet noob apparently and am only able to get the attributes for the first unit shown but not for all the rest. If I'm not mistaken, this would not be an "on the fly" solution, but rather will present ALL of the information at once in the Preview dialog. If I could get ALL the information shown, then I could try my hand at formatting in a way that is pleasing to the eye (table, colors, font size, etc.).

    Here's a sample of the REAL code:

    <?xml version="1.0" encoding="utf-8"?>
    <Configuration Location="Application/mapp/Config">
    <Group ID="DataRecorder" Name-en="DataRecorder">
    <Property ID="MaxNumberOfFiles" DataType="UINT" Value="1" Name-en="Maximum number of files" Description-en="This value defines the number of .csv files that are generated after a 'Record' command. The 'RecordDone' output is set to TRUE when the files have been created" ValueRange="1-65535" />
    <Property ID="MaxFileSize" DataType="UDINT" Value="1000" Unit-en="kB" Name-en="Maximum file size" Description-en="Defines the size of a file" ValueRange="1-51200" />
    <Property ID="DecimalDigits" DataType="UINT" Value="2" Name-en="Decimal digits" Description-en="Specifies how many decimal positions are saved" ValueRange="0-15" />
    <Property ID="SaveInterval" DataType="DINT" Value="10000" Unit-en="ms" Name-en="Save interval" Description-en="Specifies the time interval used to transfer data from internal memory to the file" ValueRange="2000-3600000" />
    <Property ID="BufferSize" DataType="UINT" Value="100" Unit-en="kB" Name-en="Buffer size" Description-en="Defines the size of internal memory" ValueRange="1-65535" />
    <Property ID="PowerFailSafe" DataType="BOOL" Value="TRUE" Name-en="Power fail-safe" Description-en="Specifies whether the data should survive a power failure (internal memory in DRAM or SRAM)" />
    </Group>
    </Configuration>

    And here's the modified stylesheet Paul was good enough to help with (basically changed for-each select):

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="">www.w3.org/.../Transform">
    <xsl:template match="/">
    <html>
    <body>

    <xsl:for-each select="Configuration/Group"><br/>
    <i>ID = <font color="#0000FF" size="2"><xsl:value-of select="Property/@ID"/></font></i><br/>
    <i>DataType = <font color="#0000FF" size="2"><xsl:value-of select="Property/@DataType"/></font></i><br/>
    <i>Value = <font color="#0000FF" size="2"><xsl:value-of select="Property/@Value"/></font></i><br/>
    <i>Name-en = <font color="#0000FF" size="2"><xsl:value-of select="Property/@Name-en"/></font></i><br/>
    <i>ValueRange = <font color="#0000FF" size="2"><xsl:value-of select="Property/@ValueRange"/></font></i><br/>
    </xsl:for-each>

    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>


    I looked into for-each and from what I understand it should find all instances of those attributes, but it only finds the ones from MaxNumberofFiles, not MaxFileSize for example. I don't know what I'm doing wrong. If it's something easy I'm overlooking, I would appreciate some additional help; otherwise, I am quite happy with the DSI app solution from Daniel, though I wish it was easier to adapt the font size to my aging eyes ;-))

    Thanks again for all your help!

Reply
  • Thanks again for the replies! I like the DSI app solution because it works out of the box and provides information "on the fly",  i.e. the screen is updated when moving along units, which is nice.

    I would have also liked to try out the stylesheet solution from Paul, but I am a stylesheet noob apparently and am only able to get the attributes for the first unit shown but not for all the rest. If I'm not mistaken, this would not be an "on the fly" solution, but rather will present ALL of the information at once in the Preview dialog. If I could get ALL the information shown, then I could try my hand at formatting in a way that is pleasing to the eye (table, colors, font size, etc.).

    Here's a sample of the REAL code:

    <?xml version="1.0" encoding="utf-8"?>
    <Configuration Location="Application/mapp/Config">
    <Group ID="DataRecorder" Name-en="DataRecorder">
    <Property ID="MaxNumberOfFiles" DataType="UINT" Value="1" Name-en="Maximum number of files" Description-en="This value defines the number of .csv files that are generated after a 'Record' command. The 'RecordDone' output is set to TRUE when the files have been created" ValueRange="1-65535" />
    <Property ID="MaxFileSize" DataType="UDINT" Value="1000" Unit-en="kB" Name-en="Maximum file size" Description-en="Defines the size of a file" ValueRange="1-51200" />
    <Property ID="DecimalDigits" DataType="UINT" Value="2" Name-en="Decimal digits" Description-en="Specifies how many decimal positions are saved" ValueRange="0-15" />
    <Property ID="SaveInterval" DataType="DINT" Value="10000" Unit-en="ms" Name-en="Save interval" Description-en="Specifies the time interval used to transfer data from internal memory to the file" ValueRange="2000-3600000" />
    <Property ID="BufferSize" DataType="UINT" Value="100" Unit-en="kB" Name-en="Buffer size" Description-en="Defines the size of internal memory" ValueRange="1-65535" />
    <Property ID="PowerFailSafe" DataType="BOOL" Value="TRUE" Name-en="Power fail-safe" Description-en="Specifies whether the data should survive a power failure (internal memory in DRAM or SRAM)" />
    </Group>
    </Configuration>

    And here's the modified stylesheet Paul was good enough to help with (basically changed for-each select):

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="">www.w3.org/.../Transform">
    <xsl:template match="/">
    <html>
    <body>

    <xsl:for-each select="Configuration/Group"><br/>
    <i>ID = <font color="#0000FF" size="2"><xsl:value-of select="Property/@ID"/></font></i><br/>
    <i>DataType = <font color="#0000FF" size="2"><xsl:value-of select="Property/@DataType"/></font></i><br/>
    <i>Value = <font color="#0000FF" size="2"><xsl:value-of select="Property/@Value"/></font></i><br/>
    <i>Name-en = <font color="#0000FF" size="2"><xsl:value-of select="Property/@Name-en"/></font></i><br/>
    <i>ValueRange = <font color="#0000FF" size="2"><xsl:value-of select="Property/@ValueRange"/></font></i><br/>
    </xsl:for-each>

    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>


    I looked into for-each and from what I understand it should find all instances of those attributes, but it only finds the ones from MaxNumberofFiles, not MaxFileSize for example. I don't know what I'm doing wrong. If it's something easy I'm overlooking, I would appreciate some additional help; otherwise, I am quite happy with the DSI app solution from Daniel, though I wish it was easier to adapt the font size to my aging eyes ;-))

    Thanks again for all your help!

Children