Altova StyleVision 2025 Enterprise Edition

As a simple example of how to automate some tasks, we add a button to the page:

 

<input type="button" value="Open File" onclick="BtnOpen()">

When clicked, a predefined document will be opened in the StyleVisionControl. The MakeAbsolutePath method creates an absolute path using the location of the script as a base path.

 

function BtnOpen()
{
  if(strPath.value.length > 0)
  {
    var absolutePath = MakeAbsolutePath(strPath.value);
    var objDoc = objStyleVisionControl.Open(absolutePath);
    if (objDoc == null)
        alert("Unable to locate " + absolutePath);
  }
  else
  {
     alert("Please give the document name to open from StyleVisionExamples folder!");
     strPath.focus();
  }
}

© 2019-2025 Altova GmbH