custom editor variables using other variables
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 72
- Joined: Thu Mar 26, 2015 4:57 pm
custom editor variables using other variables
Post by steve.cuzner »
In our environment we have a folder for each product, but shared resourced are stored at folders higher in the tree such as
I'd like to be able to have a variable, ${stylesheets}, that has the path to the stylesheets directory relative to the project folder. I've tried directly referencing ${pd} in my custom variable definition in the project file,
and using the xpath_eval construction method.
Neither seem to work, but perhaps I've got my number of .. steps in the path wrong. Is there a way to validate what a variable expands to in an editor viewer so you can more easily debug possible variable construction errors?
Code: Select all
allproducts
stylesheets
src
product1
product1.xpr
product2
product2.xpr
Code: Select all
<userEditorVariable>
<field name="name">
<String>${stylesheets}</String>
</field>
<field name="value">
<String>${pd}\..\..\stylesheets</String>
</field>
<field name="shortDescription">
<String>The stylesheets directory of the sandbox</String>
</field>
</userEditorVariable>
Code: Select all
<userEditorVariable>
<field name="name">
<String>${stylesheets}</String>
</field>
<field name="value">
<String>${xpath_eval(concat(${pd}, '\..\..\stylesheets'))}</String>
</field>
<field name="shortDescription">
<String>The stylesheets directory of the sandbox</String>
</field>
</userEditorVariable>
-
- Posts: 515
- Joined: Wed May 20, 2009 2:40 pm
Re: custom editor variables using other variables
Hi,
I tried to reproduce your problem but the custom variable value worked for me when directly referencing ${pd}.
Indeed there is a problem in the second construction method (the one that uses xpath_eval function). The arguments of the concat function must be strings so you have to wrap ${pd} value in quotes:
Can you please tell me the oXygen version that you are using? I have checked your samples using the last released version (17.0).
Another question is how do you use the custom editor variable?
I think that you can check the expressions by using them in a CSS (maybe as content for an element).
Best Regards,
Mihaela
I tried to reproduce your problem but the custom variable value worked for me when directly referencing ${pd}.
Indeed there is a problem in the second construction method (the one that uses xpath_eval function). The arguments of the concat function must be strings so you have to wrap ${pd} value in quotes:
Code: Select all
${xpath_eval(concat("${pd}", '\..\..\stylesheets'))}
Another question is how do you use the custom editor variable?
I think that you can check the expressions by using them in a CSS (maybe as content for an element).
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 72
- Joined: Thu Mar 26, 2015 4:57 pm
Re: custom editor variables using other variables
Post by steve.cuzner »
I'm using <oXygen/> XML Editor 17.0, build 2015052917
I'll try the css. Having an evaluation window/widget would be a great new feature.
I'll try the css. Having an evaluation window/widget would be a great new feature.
-
- Posts: 515
- Joined: Wed May 20, 2009 2:40 pm
Re: custom editor variables using other variables
Hi,
I have added your feature request in our internal issue tracker (to add a way to evaluate editor variables).
We will let you know when this will be available.
Best Regards,
Mihaela
I have added your feature request in our internal issue tracker (to add a way to evaluate editor variables).
We will let you know when this will be available.
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 72
- Joined: Thu Mar 26, 2015 4:57 pm
Re: custom editor variables using other variables
Post by steve.cuzner »
I've been trying to output a variable in my css and am not having any luck. Here is my code:
All I get is the literal ${pd}. If I move the variable outside the quotes, i get an error due to the }. I've searched help, forums, and looked in the distributed css for the docbook framework, but can't fine any information on how to use a variable for css.
Steve
Code: Select all
info:before {
content: "Using ${pd}";
}
Steve
-
- Posts: 515
- Joined: Wed May 20, 2009 2:40 pm
Re: custom editor variables using other variables
Hi Steve,
The ${pd} variable is not directly expanded if you are using it in the node content.
What you can do is to use its ${pdu} equivalent (that returns the current project folder as URL) inside an oxy_url function:
info:before {
content: oxy_url('${pdu}');
}
Regarding to your initial problem (the custom variable that points to the stylesheets directory) can you send us a small sample that reproduces your problem? In this way maybe we could help you find a solution. Here is our support email address: support@oxygenxml.com.
Best regards,
Mihaela.
The ${pd} variable is not directly expanded if you are using it in the node content.
What you can do is to use its ${pdu} equivalent (that returns the current project folder as URL) inside an oxy_url function:
info:before {
content: oxy_url('${pdu}');
}
Regarding to your initial problem (the custom variable that points to the stylesheets directory) can you send us a small sample that reproduces your problem? In this way maybe we could help you find a solution. Here is our support email address: support@oxygenxml.com.
Best regards,
Mihaela.
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
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