Skip to main content
Inspiring
November 22, 2024
Answered

Using Parent Element Attribute in Prefix Rules

  • November 22, 2024
  • 1 reply
  • 472 views

I have a parent Element with an attribute (DayNum). I want to use the value of this attribute in the prefix rules of a child element. I can see that I can reference an Attribute in the PrefixRule, but it doesn't seem to recognise an Attribute from a parent element.

In normal Context Rules, I can refer to the Attribute of the parent using ParentElement[ElementName = "Value"], but that doesn't seem to work in a PrefixRule.

Is this possible?

    This topic has been closed for replies.
    Correct answer frameexpert

    1 reply

    frameexpert
    Community Expert
    Community Expert
    November 22, 2024

    It should work if the EDD syntax is correct.

     

    Inspiring
    November 24, 2024

    @frameexpert What would be the syntax if it's not the immediate parent, e.g. what if the Attribute is defined on the Grandparent Element and I need to reference it on the Grandchild Element?

     

    I tried the following:

    Prefix rules

     1. If context is: Grandchild < * < Grandparent

           Prefix: Day: <$attribute[Grandparent:Daynum]>

     

    But I just get the following:

    Day: 

    frameexpert
    Community Expert
    frameexpertCommunity ExpertCorrect answer
    Community Expert
    November 24, 2024