| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
package net.sf.saxon.functions; |
| 9 |
|
| 10 |
import net.sf.saxon.expr.*; |
| 11 |
import net.sf.saxon.om.Sequence; |
| 12 |
import net.sf.saxon.trans.XPathException; |
| 13 |
import net.sf.saxon.value.AnyURIValue; |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
public class StaticBaseUri extends SystemFunction { |
| 19 |
|
| 20 |
@Override |
| 21 |
public AnyURIValue call(XPathContext context, Sequence[] args) throws XPathException { |
| 22 |
return new AnyURIValue(getRetainedStaticContext().getStaticBaseUriString()); |
| 23 |
} |
| 24 |
|
| 25 |
@Override |
| 26 |
public Expression makeFunctionCall(Expression[] arguments) { |
| 27 |
PackageData pd = getRetainedStaticContext().getPackageData(); |
| 28 |
if (pd.isRelocatable()) { |
| 29 |
return super.makeFunctionCall(arguments); |
| 30 |
} else { |
| 31 |
return Literal.makeLiteral(new AnyURIValue(getRetainedStaticContext().getStaticBaseUriString())); |
| 32 |
} |
| 33 |
} |
| 34 |
} |