jodekirk |
Newbie |
|
|
Systems Analyst/Programmer |
|
Male |
|
Thursday, December 14, 2006 |
Wednesday, January 10, 2024 4:57:26 PM |
4 [0.02% of all post / 0.00 posts per day] |
|
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
|
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
|
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
|
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
|
|