XSLT editor: how to create dynamic url for source xml file
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 4
- Joined: Thu Oct 08, 2015 11:01 am
XSLT editor: how to create dynamic url for source xml file
Hello!
I'd like to create one dynamic scenario for my xslt files based on directory, where they are stored. For example, I have xslt file located in
/home/helvdan/Desktop/my_project/folder/stylesheet.xsl
I want automatically generate url for source xml file. It should be something like this:
http://example.com/my_project/folder/stylesheet.xml
I tried the following
nothing happens - I assume it takes the current file
when I try something like this:
it concatenates current file url with expression, result is
/home/helvdan/Desktop/my_project/folder/my_project/folder/stylesheet.xsl
What is the proper way to do such things?
I'd like to create one dynamic scenario for my xslt files based on directory, where they are stored. For example, I have xslt file located in
/home/helvdan/Desktop/my_project/folder/stylesheet.xsl
I want automatically generate url for source xml file. It should be something like this:
http://example.com/my_project/folder/stylesheet.xml
I tried the following
Code: Select all
${xpath_eval( concat('http://example.com/', substring(substring('${currentFileURL}', 23), 1, string-length(substring('${currentFileURL}', 23)) - 4 ), '.xml')}
when I try something like this:
Code: Select all
${xpath_eval(substring("${currentFileURL}",28))}
/home/helvdan/Desktop/my_project/folder/my_project/folder/stylesheet.xsl
What is the proper way to do such things?
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: XSLT editor: how to create dynamic url for source xml file
Hi,
In what context are you using ${xpath_eval()}? Is it in the XML URL field from the transformation scenario?
If the result of the XPath looks like a relative path ("my_project/folder/stylesheet.xsl") then it will be considered relative to the current folder. You need to make it absolute to avoid that.
Note that there are many other editor variables that could help, rather than using substring with absolute values.
BTW, you have a typo, a missing trailing parenthesis, ')', in the expression from your first example. It should end in '.xml'))}. If nothing worked there, that may be the cause.
Regards,
Adrian
In what context are you using ${xpath_eval()}? Is it in the XML URL field from the transformation scenario?
If the result of the XPath looks like a relative path ("my_project/folder/stylesheet.xsl") then it will be considered relative to the current folder. You need to make it absolute to avoid that.
Note that there are many other editor variables that could help, rather than using substring with absolute values.
BTW, you have a typo, a missing trailing parenthesis, ')', in the expression from your first example. It should end in '.xml'))}. If nothing worked there, that may be the cause.
Regards,
Adrian
Adrian Buza
<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
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