IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: jodekirk
About
User Name: jodekirk
Forum Rank: Newbie
Real Name:
Location
Occupation: Systems Analyst/Programmer
Interests:
Gender: Male
Statistics
Joined: Thursday, December 14, 2006
Last Visit: Wednesday, January 10, 2024 4:57:26 PM
Number of Posts: 4
[0.02% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: CALS Table support header (on each page) ?
Posted: Friday, April 20, 2018 6:42:22 PM
CALS table headers automatically repeat on each page for me when generating a PDF, but doesn't look like it works with RTF.
Not sure if there's a way to customize the RTF stylesheet to repeat the headers, but there probably is some way.


Thanks,
Jeremy Odekirk
Systems Analyst / Programmer
Topic: Check current document if is valid
Posted: Friday, May 13, 2016 6:25:41 PM
I want to create a button that checks if the current document is valid. I tried the sample code but it doesn't work.

When debugging the following script I get the error: 'Application' is undefined.

Code:
var x = Application.ActiveDocument;
var err = "";
var v = x.IsValid(err);
alert(err);


How do I change this script in StyleVision so I can validate the current document in Authentic?

Also how do you validate the document according to the DTD and also the "additional validation" in the .sps file?

I also tried the sample code here but it didn't work either:
http://manual.altova.com/Stylevision/stylevisionenterprise/index.html?integpl_htmlapplev_checkdocvalidity.htm


Thanks,
Jeremy Odekirk
Systems Analyst / Programmer
Topic: CALS TABLES
Posted: Thursday, January 7, 2016 9:11:08 PM
I can't believe this still hasn't been fixed in Authentic. CALS table support for adding header and footer rows is still needed!

I have created a macro that works around this missing feature by creating buttons that hide dynamically if they are needed.

InsertFooterRow macro in JavaScript:
Code:

// Insert table footer row into last modified XML file in startFolder
// since Altova Authentic doesn't support this feature for CALS tables
var fso, startFolder, recentFile, objTextFile, file, fso;
fso = new ActiveXObject("Scripting.FileSystemObject");
startFolder = "c:\\tempfolder";
recentFile = null;
var files = fso.GetFolder(startFolder).files;
var i=0;
var subFlds = new Enumerator(files);
var s = "";
for (; !subFlds.atEnd(); subFlds.moveNext()) {
file = subFlds.item();
if((fso.GetExtensionName(file) == "xml")){
   if((recentFile === null)){
     recentFile = file;
   }
   else if ((file.DateLastModified > recentFile.DateLastModified)){
     recentFile = file;
   }
  }
}
if((recentFile === null)){
  Alert("no recent file found");
}
else{
//  Alert("Most recently modified file is " + recentFile.Name + " " + recentFile.DateLastModified);
  var strFileName;
  strFileName = fso.GetAbsolutePathName(recentFile);
  //Alert(strFileName);
  var xml;
  xml = new ActiveXObject("Msxml2.DOMDocument.6.0");
  xml.setProperty("ProhibitDTD", false);
  xml.async = "false";
  xml.validateOnParse = "false";
  xml.resolveExternals = "false";
  if (xml.load(strFileName)){
    var tfoot, row, entry;
    tfoot = xml.createElement("tfoot");
    row = xml.createElement("row");
    entry = xml.createElement("entry");
        // insert tfoot before tbody
    xml.getElementsByTagName("tgroup")[0].insertBefore(tfoot,xml.getElementsByTagName("tbody")[0]).appendChild(row).appendChild(entry);
    xml.save(strFileName);
   }
else{
  Alert("Error loading XML " + strFileName);
  Alert(xml.parseError);
}
}




Insert Header Row:
Code:

// Inserts a table header row into the last modified XML file in startFolder
// since Altova Authentic doesn't support this feature for CALS tables
var fso, startFolder, recentFile, objTextFile, file, fso;
fso = new ActiveXObject("Scripting.FileSystemObject");
startFolder = "c:\\tempfolder";
recentFile = null;
var files = fso.GetFolder(startFolder).files;
var i=0;
var subFlds = new Enumerator(files);
var s = "";
for (; !subFlds.atEnd(); subFlds.moveNext()) {
file = subFlds.item();
if((fso.GetExtensionName(file) == "xml")){
   if((recentFile === null)){
     recentFile = file;
   }
   else if ((file.DateLastModified > recentFile.DateLastModified)){
     recentFile = file;
   }
  }
}
if((recentFile === null)){
  Alert("no recent file found");
}
else{
//  Alert("Most recently modified file is " + recentFile.Name + " " + recentFile.DateLastModified);
  var strFileName;
  strFileName = fso.GetAbsolutePathName(recentFile);
  //Alert(strFileName);
  var xml;
  xml = new ActiveXObject("Msxml2.DOMDocument.6.0");
  xml.setProperty("ProhibitDTD", false);
  xml.async = "false";
  xml.validateOnParse = "false";
  xml.resolveExternals = "false";
if (xml.load(strFileName)){
  var thead, row, entry;
  thead = xml.createElement("thead");
  row = xml.createElement("row");
  entry = xml.createElement("entry");
  if (xml.getElementsByTagName("tfoot")[0]){
         // insert thead before tfoot
        xml.getElementsByTagName("tgroup")[0].insertBefore(thead,xml.getElementsByTagName("tfoot")[0]).appendChild(row).appendChild(entry);
  }
  else {
     // insert thead before tbody
    xml.getElementsByTagName("tgroup")[0].insertBefore(thead,xml.getElementsByTagName("tbody")[0]).appendChild(row).appendChild(entry);
  }
  xml.save(strFileName);
}
else{
  Alert("Error loading XML " + strFileName);
  Alert(xml.parseError);
}
}



Thanks,
Jeremy Odekirk
Systems Analyst / Programmer
Topic: How to hide doctype from Generated Java code?
Posted: Thursday, December 14, 2006 3:32:03 PM
I mapped an MS Access DB to a DTD file, and the output works fine. However, I do not want it to generate the XML with a doctype inside. Is there anyway to generate the output without a doctype declaration in the output XML file?


Thanks,
Jeremy Odekirk
Systems Analyst / Programmer

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.