Page 1 of 1

Issue including webhelp.head.script

Posted: Mon Mar 06, 2017 7:03 pm
by kmank
I am attempting to place javascript within the head element, and following the procedure in Adding Custom HTML Content in WebHelp Classic Output (https://www.oxygenxml.com/doc/versions/ ... hing2.html).

When I run the WebHelp classic transform without including webhelp.head.script, it provides the expected results. As soon as I run the transform with it, I receive the following error:

Code: Select all

System ID: C:\Program Files\Oxygen XML Editor 18\frameworks\dita\DITA-OT2.x\plugins\com.oxygenxml.webhelp\xsl\dita\dita_common.xsl
Scenario: WKFS WebHelp Classic
Input file: D:\extract\Test.ditamap
Engine name: DITA-OT
Severity: error
Description: I/O error reported by XML parser processing file:/D:/Custom%20Files/WebHelp_Classic_ftr.xml: D:\Custom Files\WebHelp_Classic_ftr.xml (The system cannot find the path specified) Cause: java.io.FileNotFoundException: D:\Custom Files\WebHelp_Classic_ftr.xml (The system cannot find the path specified)
Start location: 38:0
I'm using the placeholder included in the Adding Custom HTML Content in WebHelp Classic Output page.

Code: Select all

<script type="text/javascript">
<!--
/* Include JavaScript code here. */

function myFunction() {
return true;
}
-->
</script>
Any ideas on why it is causing the ftr file to not be found?

Re: Issue including webhelp.head.script

Posted: Wed Mar 08, 2017 11:29 am
by alin
Hello,

It is possible that you have misspelled the URL of the footer file when you set the value for the webhelp.head.script parameter. In order to be sure that the URL is correct please follow these steps:
  1. Link the file in the Project View.
  2. Right click the file in the Project View and select Copy Location. This action copies the file URL in the clipboard.
  3. Edit the webhelp.head.script parameter in the transformation scenario.
  4. In the Value field, delete the old value, then paste the location from the step 2.
Please let me know if this fixes the problem.

Regards,
Alin

Re: Issue including webhelp.head.script

Posted: Fri Mar 10, 2017 6:35 pm
by kmank
Hi Alin,
Thanks for responding. I've done some reconfiguring of the transform and for now removed the reference to the footer file.

The content within the webhelp.head.script has not changed. But now the build is failing with a new message:

Code: Select all

D:\Program Files (x86)\Oxygen XML Editor 18\frameworks\dita\DITA-OT2.x\plugins\com.oxygenxml.webhelp\build_dita.xml:358: Fatal error during transformation using D:\Program Files (x86)\Oxygen XML Editor 18\frameworks\dita\DITA-OT2.x\plugins\com.oxygenxml.webhelp\xsl\dita\desktop\dita2webhelp.xsl: Exception thrown by URIResolver; SystemID: file:/D:/Program%20Files%20(x86)/Oxygen%20XML%20Editor%2018/frameworks/dita/DITA-OT2.x/plugins/com.oxygenxml.webhelp/xsl/macroExpander.xsl; Line#: 55; Column#: -1
I'm new to the macroExpander and am unfamiliar with that function. Can you provide some direction with that? How can I eliminate this error?

Thanks again!

Re: Issue including webhelp.head.script

Posted: Mon Mar 13, 2017 4:09 pm
by alin
What is the value of the webhelp.head.script parameter?
If it points to a file, what is the content of that file?

Re: Issue including webhelp.head.script

Posted: Thu Mar 16, 2017 12:08 am
by kmank
The webhelp.head.script parameter points to: D:\oXygen Files\fragments\WebHelp_Classic_hdr.xml

The contents of the xml file contains only the Google Analytics script:

Code: Select all

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-xxxxxxxx-1', 'auto');
ga('send', 'pageview');
</script>
Thoughts?

Re: Issue including webhelp.head.script

Posted: Thu Mar 16, 2017 10:56 am
by alin
Hello,

The value of the webhelp.head.script parameter should be an URL, not a file path.
In your case it should be: file:/D:/oXygen%20Files/fragments/WebHelp_Classic_hdr.xml

Regards,
Alin

Re: Issue including webhelp.head.script

Posted: Tue Feb 05, 2019 12:17 am
by kmank
This seems to have revisited us when using our 20.0 webhelp transforms with Oxygen 20.1.
for the fragment webhelp.fragment.head, the value of C:\DITA\oXygen Files\fragments\WebHelp_Responsive_head.xml works well as a parameter in 20.0. Everything transforms as desired/expected.

When I use the same transformation in 20.1, the text for the link is injected in the page (see below). Is there some new method of handling the fragments in 20.1?

Code: Select all

        <!-- Skin resources -->
<link rel="stylesheet" type="text/css" href="oxygen-webhelp/template/blue.css?buildId=2018122203" />
<!-- EXM-36950 - Expand the args.hdf parameter here -->

C:\DITA\oXygen Files\fragments\WebHelp_Responsive_head.xml
</head>

Re: Issue including webhelp.head.script

Posted: Tue Feb 05, 2019 12:46 pm
by cosmin_andrei
Hello,

This is a known issue that we already solved and it will be available in the next released version (v21). As a workaround, you can rename the folder and avoid spaces (use underscore "_" instead of space).

If you'd like a beta build of v21 to test this, please write to our support email address, support@oxygenxml.com and ask for early access to v21.