Support for MODE in "Transform XML"

It would be nice if FinalBuilder could support the MODE parameter when doing XSL transforms.

I do quite a lot of XSLT stuff and the MODE feature is extremely useful when you are using the same XSL transform to output different types of data. The start MODE (and optional namespace) is passed to MSXML before performing the actual transform. You can see an example snippet below of how I use the setStartMode parameter. (Note this is different to using the XSLT parameters, but is often used together).

While you are at it, the last supported version of MSXML is version 4, but version 6 is already out for more than a year. Could you add support for version 6 please? BTW, version 5 of MSXML was only made available in MS Office products and you could leave this out without any issues. MSXML5 only added support for digital signatures in XML files, but this was taken out in MSXML6.

Finally. Version 6 of MSXML has very much tighter security and you need to also add maybe another property page that allows setting of certain XML properties, ie.

validateOnParse := true;
resolveExternals := true;
preserveWhiteSpace := true;

setProperty('MaxXMLSize', 1024*1024);
setProperty('ProhibitDTD', False);
setProperty('SelectionLanguage', 'XPath');
setProperty('AllowXsltScript', False);
setProperty('AllowDocumentFunction', False);

If you need code examples or help, I would be more than happy to help out.

Best regards,

Francois

 

--- Snippet of much larger VBScript code that creates a help file ---

' Create a template based on the XSL transform file 
set XSLTemplate = CreateObject("Msxml2.XSLTemplate.6.0")
XSLTemplate.stylesheet = XSLDoc

'--------------------------------------
'First, build the XML Table of Contents

set XMLTOC = CreateObject("Msxml2.DOMDocument.6.0")
set XSLProc = XSLTemplate.createProcessor()   ' Create a XSL processor
XSLProc.input = LibDef
XSLProc.output = XMLTOC
XSLProc.setStartMode("toc")
XSLProc.transform
XMLTOC.save("StdLib/toc.xml")

'---------------------------------------
'Second, build the HHC Table of Contents

set XSLProc = XSLTemplate.createProcessor()   ' Create a XSL processor
XSLProc.input = LibDef
XSLProc.setStartMode("hhc")
XSLProc.transform
set File = fso.CreateTextFile("StdLib/toc.hhc", true)
File.Write(XSLProc.output)
File.Close

'---------------------------------------
'Thirdly, build the HHK Index

set XSLProc = XSLTemplate.createProcessor()   ' Create a XSL processor
XSLProc.input = LibDef
XSLProc.setStartMode("hhk")
XSLProc.transform
set File = fso.CreateTextFile("StdLib/index.hhk", true)
File.Write(XSLProc.output)
File.Close

Hi Francois,

We should be able to add start mode support for you very shortly. In addition, I’ve placed the MSXML 6 features on our to-do list for the next release. Is there anything in particular that you need MSXML 6 in order to do, or are you only interested in the increased security?

Regards,

Angus

Hi Angus,

It is only the security features of MSXML 6 that would be an issue.

Just a warning that many of the MSDN documentation does not correctly list the default security settings. I wasted quite a bit of time with documentation explicitly listing the default security settings, while MS in the meantime changed their minds and turned the security way up. They did mention it in a Knowledge Base article, but who reads that when you have the technical documents?

Thanks for the great support. You can expect my order soon.

Regards,

Francois

Hi Francois,

We now have a FinalBuilder test build with XSLT starting mode support, if you’d like to test it out.

https://www.finalbuilder.com/downloads/finalbuilder/550/FB550_398.exe

Regards,

Angus