1 package net.sf.saxon.tinytree; 2 import net.sf.saxon.event.Receiver; 3 import net.sf.saxon.trans.XPathException; 4 import net.sf.saxon.type.Type; 5 import net.sf.saxon.om.Navigator; 6 7 12 13 14 final class TinyProcInstImpl extends TinyNodeImpl { 15 16 public TinyProcInstImpl(TinyTree tree, int nodeNr) { 17 this.tree = tree; 18 this.nodeNr = nodeNr; 19 } 20 21 public String getStringValue() { 22 int start = tree.alpha[nodeNr]; 23 int len = tree.beta[nodeNr]; 24 if (len==0) { 25 return ""; } 27 char[] dest = new char[len]; 28 tree.commentBuffer.getChars(start, start+len, dest, 0); 29 return new String (dest, 0, len); 30 } 31 32 public final int getNodeKind() { 33 return Type.PROCESSING_INSTRUCTION; 34 } 35 36 40 41 public String getBaseURI() { 42 return Navigator.getBaseURI(this); 43 } 44 45 48 49 public void copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId) throws XPathException { 50 out.processingInstruction(getDisplayName(), getStringValue(), 0, 0); 51 } 52 53 55 60 61 public String getTarget() { 62 return getDisplayName(); 63 } 64 65 70 71 public String getData() { 72 return getStringValue(); 73 } 74 75 } 76 77 78 | Popular Tags |