01: package net.sf.saxon.dom;
02:
03: import org.w3c.dom.DOMException;
04: import org.w3c.dom.ProcessingInstruction;
05:
06: /**
07: * This class is an implementation of the DOM ProcessingInstruction interface that wraps a Saxon NodeInfo
08: * representation of a text or comment node.
09: */
10:
11: public class PIOverNodeInfo extends NodeOverNodeInfo implements
12: ProcessingInstruction {
13:
14: /**
15: * The target of this processing instruction. XML defines this as being
16: * the first token following the markup that begins the processing
17: * instruction.
18: */
19: public String getTarget() {
20: return node.getLocalPart();
21: }
22:
23: /**
24: * The content of this processing instruction. This is from the first non
25: * white space character after the target to the character immediately
26: * preceding the <code>?></code>.
27: */
28: public String getData() {
29: return node.getStringValue();
30: }
31:
32: /**
33: * The content of this processing instruction. This is from the first non
34: * white space character after the target to the character immediately
35: * preceding the <code>?></code>.
36: *
37: * @throws org.w3c.dom.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
38: */
39: public void setData(String data) throws DOMException {
40: disallowUpdate();
41: }
42: }
43:
44: //
45: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
46: // you may not use this file except in compliance with the License. You may obtain a copy of the
47: // License at http://www.mozilla.org/MPL/
48: //
49: // Software distributed under the License is distributed on an "AS IS" basis,
50: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
51: // See the License for the specific language governing rights and limitations under the License.
52: //
53: // The Original Code is: all this file.
54: //
55: // The Initial Developer of the Original Code is Michael H. Kay.
56: //
57: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
58: //
59: // Contributor(s): none.
60: //
|