1 package com.icl.saxon.tinytree; 2 import com.icl.saxon.output.Outputter; 4 5 import javax.xml.transform.TransformerException ; 6 import org.w3c.dom.ProcessingInstruction ; 7 import org.w3c.dom.DOMException ; 8 9 14 15 16 final class TinyProcInstImpl extends TinyNodeImpl implements ProcessingInstruction { 17 18 public TinyProcInstImpl(TinyDocumentImpl doc, int nodeNr) { 19 this.document = doc; 20 this.nodeNr = nodeNr; 21 } 22 23 public String getStringValue() { 24 int start = document.offset[nodeNr]; 25 int len = document.length[nodeNr]; 26 if (len==0) { 27 return ""; } 29 char[] dest = new char[len]; 30 document.commentBuffer.getChars(start, start+len, dest, 0); 31 return new String (dest, 0, len); 32 } 33 34 public final short getNodeType() { 35 return PI; 36 } 37 38 41 42 public void copy(Outputter out) throws TransformerException { 43 out.writePI(getDisplayName(), getStringValue()); 44 } 45 46 48 53 54 public String getTarget() { 55 return getDisplayName(); 56 } 57 58 63 64 public String getData() { 65 return getStringValue(); 66 } 67 68 73 74 public void setData(String data) throws DOMException { 75 disallowUpdate(); 76 } 77 78 } 79 80 81 | Popular Tags |