| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
package net.sf.saxon.tree.linked; |
| 9 |
|
| 10 |
import net.sf.saxon.event.Receiver; |
| 11 |
import net.sf.saxon.expr.parser.Location; |
| 12 |
import net.sf.saxon.om.AtomicSequence; |
| 13 |
import net.sf.saxon.om.NoNamespaceName; |
| 14 |
import net.sf.saxon.om.NodeName; |
| 15 |
import net.sf.saxon.trans.XPathException; |
| 16 |
import net.sf.saxon.type.Type; |
| 17 |
import net.sf.saxon.value.StringValue; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
public class ProcInstImpl extends NodeImpl { |
| 28 |
|
| 29 |
String content; |
| 30 |
String name; |
| 31 |
String systemId; |
| 32 |
int lineNumber = -1; |
| 33 |
int columnNumber = -1; |
| 34 |
|
| 35 |
public ProcInstImpl(String name, String content) { |
| 36 |
this.name = name; |
| 37 |
this.content = content; |
| 38 |
} |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
@Override |
| 46 |
public NodeName getNodeName() { |
| 47 |
return new NoNamespaceName(name); |
| 48 |
} |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
public String getStringValue() { |
| 53 |
return content; |
| 54 |
} |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
public AtomicSequence atomize() { |
| 63 |
return new StringValue(getStringValue()); |
| 64 |
} |
| 65 |
|
| 66 |
public final int getNodeKind() { |
| 67 |
return Type.PROCESSING_INSTRUCTION; |
| 68 |
} |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
public void setLocation(String uri, int lineNumber, int columnNumber) { |
| 78 |
this.systemId = uri; |
| 79 |
this.lineNumber = lineNumber; |
| 80 |
this.columnNumber = columnNumber; |
| 81 |
} |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
public String getSystemId() { |
| 90 |
return systemId; |
| 91 |
} |
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
public int getLineNumber() { |
| 98 |
return lineNumber; |
| 99 |
} |
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
public int getColumnNumber() { |
| 106 |
return columnNumber; |
| 107 |
} |
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
public void copy( Receiver out, int copyOptions, Location locationId) throws XPathException { |
| 115 |
out.processingInstruction(getLocalPart(), content, locationId, 0); |
| 116 |
} |
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
public void rename(NodeName newNameCode) { |
| 125 |
name = newNameCode.getLocalPart(); |
| 126 |
} |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
public void replaceStringValue( CharSequence stringValue) { |
| 136 |
content = stringValue.toString(); |
| 137 |
} |
| 138 |
} |
| 139 |
|