XML Comment Xpath?

Is it possible to parse the comment attribute from a parent of a "translatable" node; then display it in the Editor?

This is my XML file

<?xml version="1.0" encoding="UTF-8"?>
<wrapper-node>
<group-node>
	<content-node comment="Apple comment">
		<text-node>
			Apple
		</text-node>
	</content-node>
</group-node>
<group-node>
	<content-node comment="Banana comment">
		<text-node>
			Banana
		</text-node>
	</content-node>
</group-node>
</wrapper-node>

Setting the the translatable node is easy enough.

But I can't find any documentation on the Comment XPath, how to define it or where the results appear.

Trados Studio Edit Rule dialog box showing XPath field with value 'text-node' and Comment XPath field with value 'ancestor::content-node@comment'.

Can anyone shed any light on this, or if there is a better way?

Thanks

Sam



Generated Image Alt-Text
[edited by: Trados AI at 5:45 AM (GMT 0) on 29 Feb 2024]
Parents Reply
  • That's funny... I actually raised a support ticket for this very thing when I tested this for you earlier!  I also tried using this:

    //text-node/../@comment

    Just in case it helped to keep the focus on the text node selected and traverse back up to the parent content-node for the comment, but that gives me the same problem.  Unless has some idea of what could be used here I think think we'll need to wait for a comment from the support team.

    As a workaround you could try making this part of the DSI info and then see the comments with the DSI Viewer, or in the navigation pane... or even better just create a simple stylesheet to preview them as you work.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji
Children