changing attribute name, not value, with form controls in Author View
Oxygen general issues.
-
- Posts: 87
- Joined: Fri Dec 19, 2003 6:02 pm
changing attribute name, not value, with form controls in Author View
Hi.
I have a date picker form control like this:
It works as expected and it enters the date into the `@when` attribute. So far so good.
In TEI, however, we need to use a different attribute for inexact dates, either `@notBefore` or `@notAfter`. So, next to the date picker, I'd like to add an oxy_comobox with the default value `@when`, and two additional values `@notBefore` and `@notAfter`, and then an oxy_action onChange that would replace `@when` with the selected attribute name (`@notBefore` or `@notAfter`) and keep the date picker working with the new attribute.
Is this something that can be done? If not, what's the most elegant way of giving the user this kind of choice without overcrowding the form?
Many thanks in advance.
All best,
Toma
I have a date picker form control like this:
Code: Select all
correspAction date:before {
font-family: "Platforma Sans", sans-serif;
content:
oxy_label(text, "Датум: ", width, 30%)
oxy_datePicker(edit, '@when', width, 23%, format, 'yyyy-MM-dd', fontInherit, true, color, inherit);
}
In TEI, however, we need to use a different attribute for inexact dates, either `@notBefore` or `@notAfter`. So, next to the date picker, I'd like to add an oxy_comobox with the default value `@when`, and two additional values `@notBefore` and `@notAfter`, and then an oxy_action onChange that would replace `@when` with the selected attribute name (`@notBefore` or `@notAfter`) and keep the date picker working with the new attribute.
Is this something that can be done? If not, what's the most elegant way of giving the user this kind of choice without overcrowding the form?
Many thanks in advance.
All best,
Toma
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: changing attribute name, not value, with form controls in Author View
Post by alex_jitianu »
Hello,
In theory it sounds feasible. The onChange can execute an XQueryUpdateOperation, for example, to refactor the document. Afterwards, to make the date picker edit a different attribute you can rely on a number of extra selectors:
Best regards,
Alex
In theory it sounds feasible. The onChange can execute an XQueryUpdateOperation, for example, to refactor the document. Afterwards, to make the date picker edit a different attribute you can rely on a number of extra selectors:
Code: Select all
correspAction date[notBefore]:before {
font-family: "Platforma Sans", sans-serif;
content:
oxy_label(text, "Датум: ", width, 30%)
oxy_datePicker(edit, '@notBefore', width, 23%, format, 'yyyy-MM-dd', fontInherit, true, color, inherit);
}
correspAction date[notAfter]:before {
font-family: "Platforma Sans", sans-serif;
content:
oxy_label(text, "Датум: ", width, 30%)
oxy_datePicker(edit, '@notAfter', width, 23%, format, 'yyyy-MM-dd', fontInherit, true, color, inherit);
}
Alex
-
- Posts: 87
- Joined: Fri Dec 19, 2003 6:02 pm
Re: changing attribute name, not value, with form controls in Author View
That's very cool, Alex. I see I can also do it with XSLT, which is easier for me.
The one bit that I'm still missing is how to pass the selected value from the combobox to my XSLT script:
What do I need to put there instead of ??? to refer to the selected value?
Many thanks in advance.
All best,
Toma
The one bit that I'm still missing is how to pass the selected value from the combobox to my XSLT script:
Code: Select all
oxy_combobox(
edit, "@ana",
editable, false,
values, "when, notAfter, notBefore",
labels, "тачно, пре, после",
onChange, oxy_action(
name, 'Refactor Date',
description, 'Change the attribute depending on selected value',
operation, 'ro.sync.ecss.extensions.commons.operations.XSLTOperation',
arg-script, '${pd}/xslt/refactorDate.xsl'
arg-sourceLocation, '.',
arg-targetLocation, '.',
arg-externalParams, 'dateKind=???')
)
Many thanks in advance.
All best,
Toma
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: changing attribute name, not value, with form controls in Author View
Post by alex_jitianu »
Hi Toma,
I think that you can use xpath_eval, like this: . Another option is to use XQueryUpdateOperation which is invoked in the content of the element:
I think that you can use xpath_eval, like this:
Code: Select all
'dateKind= ${xpath_eval(@ana)}'
Code: Select all
onChange, oxy_action(
name, 'Insert',
operation, 'XQueryUpdateOperation',
arg-script, 'insert node <product>{xs:string(@attribute)}</product>
as last into .')
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service