Project

Profile

Help

Overriding a function

Added by Anonymous almost 19 years ago

Legacy ID: #3284421 Legacy Poster: James Birchfield (moatas)

Is it possible to override a built-in function of Saxon? For instance, I want to provide my own implementation of the Collection function that does not read the xml files to be used from within a single document. Perhaps it would find them in a database or similar. Is this possible? Thanks! Birch


Replies (2)

RE: Overriding a function - Added by Anonymous almost 19 years ago

Legacy ID: #3284650 Legacy Poster: Michael Kay (mhkay)

You can't override a system function (a function such as collection() in the fn namespace). However, Saxon 8.5 allows you to specify a CollectionURIResolver which does the real work of this function, taking a URI as input and returning a set of documents as the result. See method setCollectionURIResolver in the Configuration class. Michael Kay http://www.saxonica.com/

RE: Overriding a function - Added by Anonymous almost 19 years ago

Legacy ID: #3284937 Legacy Poster: James Birchfield (moatas)

Thanks Michael. That looks like it will do exactly what I want. Birch

    (1-2/2)

    Please register to reply