{
Configuration configuration = ((TransformerFactoryImpl) factory).getConfiguration();
XPathStaticContext xpathContext = new IndependentContext(configuration);
if (!xpathContext.getFunctionLibrary().isAvailable(LineNumberFunction.QNAME, -1))
{
configuration.registerExtensionFunction(new LineNumberFunction());
}
if (!xpathContext.getFunctionLibrary().isAvailable(ColumnNumberFunction.QNAME, -1))
{
configuration.registerExtensionFunction(new ColumnNumberFunction());
}