Issue including webhelp.head.script

kmank
Posts: 79

Issue including webhelp.head.script

Mon Mar 06, 2017 7:03 pm

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?
alin
Site Admin
Posts: 117

Re: Issue including webhelp.head.script

Wed Mar 08, 2017 11:29 am

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
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
kmank
Posts: 79

Re: Issue including webhelp.head.script

Fri Mar 10, 2017 6:35 pm

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!
alin
Site Admin
Posts: 117

Re: Issue including webhelp.head.script

Mon Mar 13, 2017 4:09 pm

What is the value of the webhelp.head.script parameter?
If it points to a file, what is the content of that file?
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
kmank
Posts: 79

Re: Issue including webhelp.head.script

Thu Mar 16, 2017 12:08 am

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?
alin
Site Admin
Posts: 117

Re: Issue including webhelp.head.script

Thu Mar 16, 2017 10:56 am

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
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 3 guests