XProc Option Setup
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 57
- Joined: Tue Jul 21, 2009 1:48 am
XProc Option Setup
Hi, I'm trying to set up an option in an XProc Transform dialog that uses the ${ask(...)} editor variable.
I'm trying to get a default value set as timestamp is in this format: 'YYYY-MM-DDTHH:MM'.
What I've tried thus far is:
Neither seem to work. Not sure whether these editor variables just don't work for XProc or if I have some sort of syntax error.
I also noticed a few other things with the XProc implementation:
1) If you pass an empty option value via an ${ask()} dialog, the default 'select' value declared on the p:option is not honored
2) in the XProc editor, you have to save before the validation is updated (which is not the case in other editors)
Not sure if that's per design or not but both seem inconvenient...
Thanks, Scott
I'm trying to get a default value set as timestamp is in this format: 'YYYY-MM-DDTHH:MM'.
What I've tried thus far is:
Code: Select all
${ask( 'Set build date as',generic,${date('yyyy-MM-ddTHH:MM')})}
${ask('Set build date as',generic,${xpath_eval(format-dateTime(current-dateTime(),'[Y0001]-[M01]-[D01]T[h01]:[m01]'))})}
I also noticed a few other things with the XProc implementation:
1) If you pass an empty option value via an ${ask()} dialog, the default 'select' value declared on the p:option is not honored
2) in the XProc editor, you have to save before the validation is updated (which is not the case in other editors)
Not sure if that's per design or not but both seem inconvenient...
Thanks, Scott
-
- Posts: 143
- Joined: Tue Mar 25, 2003 11:21 am
Re: XProc Option Setup
Hello Scott,
The correct usage for the $date() editor variable is: Use this, and the correct behavior will occur.
Validation as you type is also available in the XProc editor, and should work for your document as well.
Regarding the empty option value via an ${ask()} dialog, I will investigate further and see if there is a problem on our side or on Calabash.
Regards,
Mircea.
The correct usage for the $date() editor variable is:
Code: Select all
${date(yyyy-MM-dd'T'HH:mm)}
Validation as you type is also available in the XProc editor, and should work for your document as well.
Regarding the empty option value via an ${ask()} dialog, I will investigate further and see if there is a problem on our side or on Calabash.
Regards,
Mircea.
Mircea Enachescu
<oXygen> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 57
- Joined: Tue Jul 21, 2009 1:48 am
Re: XProc Option Setup
Thanks for the reply Mircea. I tried the new date format in this:
with no success:
Thanks, Scott
Code: Select all
${ask('Set build date as',generic,${date(yyyy-MM-dd'T'HH:mm)})}
2022-09-16 08_06_44-Start.png
Regarding validation, is there some sort of switch that turns it on/off for a particular editor type? I have "Enable Automatic Validation" set and I'm absolutely certain that I can type an erroneous XProc pattern and does not red-line it until I save, and any fix requires a save to updated as well. Not the case in my other editors, just XProc.Thanks, Scott
You do not have the required permissions to view the files attached to this post.
-
- Posts: 143
- Joined: Tue Mar 25, 2003 11:21 am
Re: XProc Option Setup
Hi Scott,
This is the correct writing of the editor variable:
The call for ${date(yyyy-MM-dd'T'HH:MM)} must be surrounded by apostrophes as well since it is expanded on the second iteration of the expression.
Regards,
Mircea.
This is the correct writing of the editor variable:
Code: Select all
${ask( 'Set build date as',generic,'${date(yyyy-MM-dd'T'HH:MM)}')}
Regards,
Mircea.
Mircea Enachescu
<oXygen> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 143
- Joined: Tue Mar 25, 2003 11:21 am
Re: XProc Option Setup
Mircea Enachescu
<oXygen> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 57
- Joined: Tue Jul 21, 2009 1:48 am
Re: XProc Option Setup
Yes, I was using that page and generally I find that documentation excellent - I was referring to the fact that there is only a single example showing that sort of quoting (the very last line of the article) and no indication otherwise that parameters using editor variables will need to be quoted.
My suggestion might be a Note directly after the first Note on the page saying something like:
It's interesting the quotes around the T don't have to be escaped somehow or be doubles - I'd think the parser might stumble on that. It works though...
Scott
My suggestion might be a Note directly after the first Note on the page saying something like:
It just makes that fact a bit more visible... I'm sure to some folks it's a bit more obvious but obviously I never got around to trying it that way until you told me!NOTE: The use of editor variables within a parameter of another editor variable must be within single quotes for them to be properly expanded. Example:Code: Select all
${ask( 'Provide a date',generic,'${date(yyyy-MM-dd'T'HH:MM)}')}
It's interesting the quotes around the T don't have to be escaped somehow or be doubles - I'd think the parser might stumble on that. It works though...
Scott
-
- Posts: 143
- Joined: Tue Mar 25, 2003 11:21 am
Re: XProc Option Setup
Hi Scott,
I understand, that is an excellent remark !
We will do that change in documentation for sure !
Regards,
Mircea.
I understand, that is an excellent remark !
We will do that change in documentation for sure !
Regards,
Mircea.
Mircea Enachescu
<oXygen> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Return to “General XML Questions”
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