Editor variables within ${xpath_eval(expression)} in ant parameter [Eclipse plugin]
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 19
- Joined: Tue Jul 16, 2013 7:36 pm
Editor variables within ${xpath_eval(expression)} in ant parameter [Eclipse plugin]
Dear all,
Is it possible to use editor variables (e.g., ${cfd}) inside an xpath function as a parameter for an ant transformation?
I want to be able to truncate the current file directory path (or similar path) using the substring-before() function, and append the remainder of the path to a sibling directory. Something like:
If so, I cannot get the syntax right. When I run the transformation the path assigned to the parameter begins with /oxygen.
If someone can point out my error I'd much appreciate it.
HL
Is it possible to use editor variables (e.g., ${cfd}) inside an xpath function as a parameter for an ant transformation?
I want to be able to truncate the current file directory path (or similar path) using the substring-before() function, and append the remainder of the path to a sibling directory. Something like:
Code: Select all
${xpath_eval(substring-before('${cfd}','msword'))}/oxygen/ant/buildFile.xml
If someone can point out my error I'd much appreciate it.
HL
-
- Posts: 9437
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Editor variables within ${xpath_eval(expression)} in ant parameter [Eclipse plugin]
Hi Hayim,
This should work, I tested an example on my side and it worked. The xpath_eval editor variable is expanded after all other editor variables have been expanded precisely to help with use cases like yours.
Maybe you should first try something like:
just to have a better idea of what the cfd expands to.
Also the "substring-before" is case sensitive when searching for the string.
Regards,
Radu
This should work, I tested an example on my side and it worked. The xpath_eval editor variable is expanded after all other editor variables have been expanded precisely to help with use cases like yours.
Maybe you should first try something like:
Code: Select all
${cfd}
Also the "substring-before" is case sensitive when searching for the string.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 19
- Joined: Tue Jul 16, 2013 7:36 pm
Re: Editor variables within ${xpath_eval(expression)} in ant parameter [Eclipse plugin]
Hi. Thanks for you reply.
Here is the path to archive directory (I am transforming a word doc; but I have used ${cfd} with the same effect):
The parameter "mtTranscrDir" is set as ${xpath_eval(substring-before('${afd}','msword'))}
and the build file appends this path fragment, "\oxygen\xsl\TEIP5-to-mtTranscr.xsl", to the parameter.
The console reports:
I am hoping that I am missing something simple, but I can't get this to work.
Here is the path to archive directory (I am transforming a word doc; but I have used ${cfd} with the same effect):
Code: Select all
C:\Users\ ... \mtTranscr-project\mttranscr\msword
and the build file appends this path fragment, "\oxygen\xsl\TEIP5-to-mtTranscr.xsl", to the parameter.
The console reports:
Code: Select all
"-DmtTranscrDir="
...
stylesheet C:\oxygen\xsl\TEIP5-to-mtTranscr.xsl doesn't exist
...
-
- Posts: 9437
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Editor variables within ${xpath_eval(expression)} in ant parameter [Eclipse plugin]
Hi Hayim,
So you open a DOCX document in the Oxygen Archive browser, open from it the "document.xml" and then apply an ANT transformation to it (probably to convert the Word to TEI).
And in the transformation scenario you set a parameter called mtTranscrDir to:
but in the ANT console the parameter mtTranscrDir has an empty value, right?
I tested something very similar and it worked for me. What Oxygen version are you using?
Regards,
Radu
So you open a DOCX document in the Oxygen Archive browser, open from it the "document.xml" and then apply an ANT transformation to it (probably to convert the Word to TEI).
And in the transformation scenario you set a parameter called mtTranscrDir to:
Code: Select all
${xpath_eval(substring-before('${afd}','msword'))}
I tested something very similar and it worked for me. What Oxygen version are you using?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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