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.

CALS TABLES Options · View
Marc Sauvage
Posted: Friday, November 24, 2006 7:56:20 AM
Rank: Newbie

Joined: 10/26/2006
Posts: 4
Location: Paris
HI,
When I edit, in Authentic browser, an XML file containing an XML CALS table with a THEAD part and TBODY part it works. If I create a table in Authentic, I can just have the tbody part of the table. Is there a way to create the THEAD part ?

Thank you for your answer

Regards

Marc
jens
Posted: Tuesday, April 3, 2007 1:15:49 PM
Rank: Newbie

Joined: 4/3/2007
Posts: 1
Location: D
Hi Marc,

I work with the html-table-standard and I have the same problem with <thead>.

I wrote the Problem to Altova Technical Support Team.
This is the answer:

"Entered on 2007-03-13 at 11:28:54 by Paul Rees:
Hello Jens,

Thanks for contacting us.

I am afraid that this is not currently possible but we do already have it logged as a feature request in our issues tracking database. It has the tracking
number and title:

"12010 - Would like to add Header and Footer (thead, tfoot) to a new CALS/HTML table. - not possible at present."

..and I have added your details to the record to help strengthen its chances of early consideration.

I would encourage you to subscribe to our occasional Developer's Newsletter to receive alerts regarding new releases which may at some point see this
request realised:

https://www.altova.com/joinspylist.html

Thanks for the feedback - it's much appreciated.

Don't hesitate to let me know if I can be of any further assistance.

Best regards,

.. Paul Rees
.. Support Engineer
.. Altova GmbH"

Now I´am waiting and hope it works in future version.

Regards

Jens
jodekirk
Posted: Thursday, January 7, 2016 9:11:08 PM
Rank: Newbie

Joined: 12/14/2006
Posts: 4
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);
}
}
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

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