On 8/17/07, David Bertoni <[EMAIL PROTECTED]> wrote:
> Nicholas Bastin wrote:
> > We're starting to have real problems with the fact that XNumber in our
> > extension function argument lists only resolves to a double, which
> > leads me to two questions:
> >
> > 1) Is there any sort of standard validator mechanism that we can use
> > to validate that a particular argument is of the right type (not just
> > "number") before we get it out on the other side?
> What types are you interested in, and what is "the other side?"

Basically, the code that reads over the values in XObjectArgVectorType&.

> > Also, maybe there's a mechanism for writing custom argument parsers?
> > The documentation isn't that thorough on the subject of extension
> > functions, so I could be missing something entirely.
> I'm not sure what you mean by a "custom argument parser."  Can you be more
> specific?  Do you mean parsing numeric literals in XPath expressions?  If
> so, then you would need to modify Xalan-C yourself to extend it.

Basically, so we could feed our own subclasses of XObject into the
XObjectArgVectorType object between when the extension is called in
the XSLT, and the extension function is actually called.  Some sort of
a Validator shim, so to speak.

> The easiest way for you to implement this is by having a factory function
> that accepts a string literal that indicates what sort of XObject
> derivative you want to create, parses that string, then creates the right
> instance of one of your derived types.  You can then pass that to your
> extensions functions, or to one of the standard functions, as long as you
> observe my previous point 2.

Yeah, this seems like the way to go in the current architecture.  Just
grab the XalanDocumentFragment from each argument and write our own
argument list parser.

--
Nick

Reply via email to