Flynn1179
Flynn1179

Reputation: 12075

Adding custom functions to XSL in Delphi 7

I'm trying to get an XSL to use functions on an extension object, but everything I try just keeps telling me the functions don't exist.

In my lib_TLB.pas file, I've got

function Get_ReadOnly: WordBool; safecall;

defined on an interface that implements IDispatch, and I'm passing that to my IXSLProcessor with proc.AddObject( obj, 'foo' );

I'm declaring xmlns:foo="foo" in the xsl:stylesheet element, but when I try using <xsl:value-of select="foo:Get_ReadOnly()"/> It just says the function doesn't exist.

Am I missing a step somewhere, or calling it wrong?

EDIT: On closer inspection, it DOES work, just not for any function that's the getter of a property. That function had an associated property, and foo:get-ReadOnly() worked fine. Either that, or it's because the function that's defined on the implementation of that interface is 'protected' rather than 'public'.

Either way, if anyone can shed some light on what the rules on how this works are rather than me fumbling around with trial and error, I'd be grateful.

Upvotes: 4

Views: 174

Answers (0)

Related Questions