Project

Profile

Help

Revision 94703c26

Added by Michael Kay 9 months ago

Bug 4752 - introduce EmptySource class so a URIResolver can say "do nothing, ignore this request"

View differences:

src/main/java/net/sf/saxon/style/UseWhenFilter.java
19 19
import net.sf.saxon.functions.DocumentFn;
20 20
import net.sf.saxon.functions.ElementAvailable;
21 21
import net.sf.saxon.functions.FunctionLibraryList;
22
import net.sf.saxon.lib.EmptySource;
22 23
import net.sf.saxon.lib.Feature;
23 24
import net.sf.saxon.lib.NamespaceConstant;
24 25
import net.sf.saxon.om.*;
25 26
import net.sf.saxon.s9api.Location;
26
import net.sf.saxon.trans.XmlProcessingException;
27 27
import net.sf.saxon.trans.XPathException;
28
import net.sf.saxon.trans.XmlProcessingException;
28 29
import net.sf.saxon.trans.packages.UsePack;
29 30
import net.sf.saxon.tree.AttributeLocation;
30 31
import net.sf.saxon.tree.linked.DocumentImpl;
......
35 36
import javax.xml.transform.Source;
36 37
import javax.xml.transform.TransformerException;
37 38
import javax.xml.transform.URIResolver;
39
import javax.xml.transform.stream.StreamSource;
38 40
import java.io.File;
41
import java.io.StringReader;
39 42
import java.math.BigDecimal;
40 43
import java.net.URI;
41 44
import java.net.URISyntaxException;
......
304 307
            if (source == null) {
305 308
                source = getConfiguration().getSystemURIResolver().resolve(href, baseUriStr);
306 309
            }
310
            if (source instanceof EmptySource) {
311
                source = new StreamSource(new StringReader(
312
                        "<xsl:transform version='3.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'/>"));
313
            }
307 314
            NestedIntegerValue newPrecedence = precedence;
308 315
            if (isImport) {
309 316
                newPrecedence = precedence.getStem().append(precedence.getLeaf() - 1).append(2 * ++importCount);

Also available in: Unified diff