Skip to main content
Participant
April 4, 2018
Question

Issue importing xml text to Captivate

  • April 4, 2018
  • 1 reply
  • 204 views

Hi guys,

I have used Javascript to import text from an xml document to a Captivate Text Caption box, This part works fine. However, when clicking on the buttons, the correct text shows but seem to get cut off (see image below). I have resized the caption box in captivate but this doesn't seem to do anything.

I

Javacsript called on Slide Enter

var myArray = new Object();

if (window.XMLHttpRequest)

  {// code for IE7+, Firefox, Chrome, Opera, Safari

  xmlhttp=new XMLHttpRequest();

  }

else

  {// code for IE6, IE5

  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

  }

xmlhttp.open("GET","CpFeatures.xml",false);

xmlhttp.send();

xmlDoc=xmlhttp.responseXML;

var x=xmlDoc.getElementsByTagName("entity");

for (i=0;i<x.length;i++)

  {

  //alert(x.childNodes[0].nodeValue);

  var at = x.attributes;

  //myArray[at.getNamedItem("qu").value] = x.childNodes[0].nodeValue;

  myArray[i+1] = x.childNodes[0].nodeValue;

  }

window.cpAPIInterface.setVariableValue("FirstSetofOptions","Click on each tab to learn more about it.");

Javascript used to get first entity

window.cpAPIInterface.setVariableValue("FirstSetofOptions", window.myArray[1]);

Does anyone know how I can get all the xml imported text to show in the Captivate caption box? I have tried changing the Autosize Captions in the preferences to no avail.

Any help would be greatly appreciated.

Thanks

    This topic has been closed for replies.

    1 reply

    Lilybiri
    Legend
    April 4, 2018

    I would have suggested Autosize before importing but I never used JS to import, only File, Import.