Show XML attribute value in document structure information !

I am working in a specific XML type:


<Product ID="2112570">

<Values>

<Value AttributeID="Colour">foo</Value>
<Value AttributeID="Size">foo</Value>
<MultiValue AttributeID="CODE">

<Value>8717868033539</Value>

</MultiValue>

<Value AttributeID="Description">foo</Value>

</Values>

</Product>

I designed a custom XML file type, with parser rules that work fine, except for the Document Explorer. In the Document Structure pane of the Editor, I want to show a hierarchical view:

[Product ID value]

Colour

Size

Description

In other words, I want to use the value of the Product element's ID attribute. I can easily come up with an XPath and put it in the parser rules. However, Studio doesn't take the value (e.g. 2112570), but the name of the attribute (e.g. Product ID).

I'd think this would work, but it doesn't:

I found another user on this forum who managed to do it, but I don't understand his solution: https://community.sdl.com/product-groups/translationproductivity/f/studio/8664/display-element-content-in-document-explorer-in-studio-editor

Any help would be appreciated!

Parents Reply
  • What I meant three years ago is the following:
    If you want to display text node content in the "navigation pane", you need to define a parser rule for the specific element, even if this parser rule is not needed for anything else, since this element is supposed to be handled in the Studio default manner (structure and not inline / translatable unless "not-translatable" is inherited from higher hierarchical level).
    (You will probably know that defining XML parser rules (for a specific element) is only needed, if the node should be handled in a non-default way.)
    In the "Document Structure Information" column on the other hand, you are able to extract XML content from a completely different part of the XML document using relative XPath statements that allow you to extract virtually whatever XML node you are interested in.

Children
No Data