Get input values for $ask from another file
Oxygen general issues.
-
- Posts: 16
- Joined: Sat May 30, 2015 2:18 am
Get input values for $ask from another file
Hello,
I want to use the $ask variable to provide a drop-down menu with a large number of options. It would be easier to maintain this list in a separate file rather than in the template. Could the list of real and rendered values be pulled from a separate file?
I want to use the $ask variable to provide a drop-down menu with a large number of options. It would be easier to maintain this list in a separate file rather than in the template. Could the list of real and rendered values be pulled from a separate file?
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Get input values for $ask from another file
Post by alex_jitianu »
Hello,
You can use an ${oxy_xpath()} in place of the value enumeration, something like this:
In the example above I made the assumption that the values file looks like this:
You can add an entry in a catalog file to identify the values file. The catalog can sit inside the framework and be added in the Catalogs tab. This way you can avoid specifying hard coded absolute paths that wont work on every machine, as well as relying on relative paths that might not resolve to the expected base.
Best regards,
Alex
You can use an ${oxy_xpath()} in place of the value enumeration, something like this:
Code: Select all
${ask(
'combobox with quotes',
combobox,
(${xpath_eval(string-join(for $e in doc('URL_MAPPED_IN_A_CATALOG')//entry return concat('"', $e/text(), '":"', $e/@label, '"'), ';'))})}
Code: Select all
<root>
<entry label="L1">V1</entry>
<entry label="L2">V2</entry>
</root>
Best regards,
Alex
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