| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
package net.sf.saxon.tree.iter; |
| 9 |
|
| 10 |
import net.sf.saxon.Configuration; |
| 11 |
import net.sf.saxon.expr.XPathContext; |
| 12 |
import net.sf.saxon.expr.parser.Location; |
| 13 |
import net.sf.saxon.trans.XPathException; |
| 14 |
|
| 15 |
import java.io.LineNumberReader; |
| 16 |
import java.io.Reader; |
| 17 |
import java.net.URI; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
public class UnparsedTextIterator extends TextLinesIterator { |
| 23 |
|
| 24 |
XPathContext context; |
| 25 |
String encoding = null; |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
public UnparsedTextIterator(URI absoluteURI, XPathContext context, String encoding, Location location) throws XPathException { |
| 38 |
Configuration config = context.getConfiguration(); |
| 39 |
Reader reader = context.getController().getUnparsedTextURIResolver().resolve(absoluteURI, encoding, config); |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
this.reader = new LineNumberReader(reader); |
| 44 |
this.uri = absoluteURI; |
| 45 |
this.context = context; |
| 46 |
this.checker = context.getConfiguration().getValidCharacterChecker(); |
| 47 |
this.encoding = encoding; |
| 48 |
this.location = location; |
| 49 |
} |
| 50 |
|
| 51 |
public UnparsedTextIterator(LineNumberReader reader, URI absoluteURI, XPathContext context, String encoding) throws XPathException { |
| 52 |
this.reader = reader; |
| 53 |
this.uri = absoluteURI; |
| 54 |
this.context = context; |
| 55 |
this.checker = context.getConfiguration().getValidCharacterChecker(); |
| 56 |
this.encoding = encoding; |
| 57 |
this.location = null; |
| 58 |
} |
| 59 |
|
| 60 |
} |
| 61 |
|