| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
package net.sf.saxon.om; |
| 9 |
|
| 10 |
import net.sf.saxon.event.Receiver; |
| 11 |
import net.sf.saxon.expr.parser.Location; |
| 12 |
import net.sf.saxon.trans.XPathException; |
| 13 |
import net.sf.saxon.tree.iter.AxisIterator; |
| 14 |
import net.sf.saxon.tree.wrapper.AbstractVirtualNode; |
| 15 |
import net.sf.saxon.type.Type; |
| 16 |
|
| 17 |
import javax.xml.transform.Source; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
public class DocumentInfo extends AbstractVirtualNode { |
| 27 |
|
| 28 |
public DocumentInfo(NodeInfo node) { |
| 29 |
if (node.getNodeKind() != Type.DOCUMENT) { |
| 30 |
throw new IllegalArgumentException("DocumentInfo must only be used for document nodes"); |
| 31 |
} |
| 32 |
this.node = node; |
| 33 |
this.parent = null; |
| 34 |
this.docWrapper = node.getTreeInfo(); |
| 35 |
} |
| 36 |
|
| 37 |
@Override |
| 38 |
public void copy(Receiver out, int copyOptions, Location locationId) throws XPathException { |
| 39 |
node.copy(out, copyOptions, locationId); |
| 40 |
} |
| 41 |
|
| 42 |
@Override |
| 43 |
public NodeInfo getParent() { |
| 44 |
return null; |
| 45 |
} |
| 46 |
|
| 47 |
@Override |
| 48 |
public AxisIterator iterateAxis(byte axisNumber) { |
| 49 |
return node.iterateAxis(axisNumber); |
| 50 |
} |
| 51 |
} |
| 52 |
|