Using ChangeAttributeOperation in oxy_combobox onChange

Questions about XML that are not covered by the other forums should go here.
Posts: 3
Joined: Fri Jan 22, 2021 5:01 pm

Using ChangeAttributeOperation in oxy_combobox onChange

Post by Johannab_31 » Fri Jan 22, 2021 5:34 pm


I hope you can help. I'm using XML Editor 20.1 and XML Author 20.1. I'm working on a custom CSS style-sheet that will be used online in the Web Author.

I want to update the outputclass attribute value based on the value that the user enters for the title element. The title element will be a combobox.

DITA xml

Code: Select all

<concept deliverymethod="E-Learning" id="concept-cpr_zxf_2op" outputclass="need_to_know">
		<title>Need To Know</title>

I got it to work using the 'XQueryUpdateOperation' but I believe that isn't supported in the web author so I switched to using the 'ChangeAttributeOperation' operation i.e.


Code: Select all

learningContent[outputclass~="stay_current"] *[class~="concept/concept"] > *[class~="topic/title"]:first-child:before {
    content: oxy_label(text, "Title*: ", styles, "width:5%; color:black;")
            edit, "#text",
            editable, false,
            values, "Highlights, Need To Know, Assessment",
            /*onChange, oxy_action(
                name, 'Insert',
                operation, 'XQueryUpdateOperation',
                arg-script, 'replace value of node ../@outputclass with replace(lower-case(.), " ", "_")')
            onChange, oxy_action(
                name, 'ChangeOutputClass',
                operation, 'ChangeAttributeOperation',
                arg-name, 'outputclass',
                arg-elementLocation, '..',
                arg-value, oxy_xpath("replace(lower-case(text()), ' ', '_')")
The problem is that @outclass is updated with the title value before the dropdown change e.g if the title is 'TEST 1' and I change it to "TEST 2" the value of @outputclass is changed to 'TEST 1' - not the new value.

Can you figure out a way to achieve this?

Many Thanks for your help

Posts: 340
Joined: Thu Sep 04, 2014 4:22 pm

Re: Using ChangeAttributeOperation in oxy_combobox onChange

Post by cristi_talau » Fri Jan 22, 2021 6:01 pm


The support for onChange property was added in version 21.1 of Web Author. Are you able to upgrade Web Author to a newer version to solve this issue?


Post Reply