I have some working code using Delphi's TXMLDocument class, and using the TransformNode method to perform XSLT translation.
But, I need to enable XSLT Javascript functions (<msxml:script>
tags) and - after much googling - this means I need to set the AllowXsltScript
property of the IXMLDOMDocument2
to true.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms760290(v=vs.85).aspx
I've achieved this successfully - but only by modifying the source of the Delphi Library function CreateDOMDocument
in msxmldom.pas
.
function CreateDOMDocument: IXMLDOMDocument;
var doc :IXMLDOMDocument2;
begin
doc := TryObjectCreate([CLASS_DOMDocument60, CLASS_DOMDocument40, CLASS_DOMDocument30,
CLASS_DOMDocument26, msxml.CLASS_DOMDocument]) as IXMLDOMDocument2;
if not Assigned(doc) then
raise DOMException.Create(SMSDOMNotInstalled);
doc.setProperty('AllowXsltScript', true); // Allow XSLT scripts!!
Result := doc;
end;
Obviously this is far from satisfactory - so how can I access IXMLDOMDocument2 objects without modifying library code??