public String getAsString() { return ((ProcessingInstruction) node).getData(); }
public String getAsString() { return ((ProcessingInstruction) node).getData(); }
/** * Get the data of a processing instruction node. * * @param obj the processing instruction * @return the target of the processing instruction * @throws ClassCastException if obj is not a processing instruction * */ public String getProcessingInstructionData(Object obj) { if (isProcessingInstruction(obj)) { ProcessingInstruction pi = (ProcessingInstruction) obj; return pi.getData(); } throw new ClassCastException(obj + " is not a processing instruction"); }
private void visit( Node n ) throws SAXException { setCurrentLocation( n ); // if a case statement gets too big, it should be made into a separate method. switch(n.getNodeType()) { case Node.CDATA_SECTION_NODE: case Node.TEXT_NODE: String value = n.getNodeValue(); receiver.characters( value.toCharArray(), 0, value.length() ); break; case Node.ELEMENT_NODE: visit( (Element)n ); break; case Node.ENTITY_REFERENCE_NODE: receiver.skippedEntity(n.getNodeName()); break; case Node.PROCESSING_INSTRUCTION_NODE: ProcessingInstruction pi = (ProcessingInstruction)n; receiver.processingInstruction(pi.getTarget(),pi.getData()); break; } }
} else if (n.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) { ProcessingInstruction pi = (ProcessingInstruction) n; nextIndex += "<?".length() + pi.getTarget().length() + "?>".length() + pi.getData().length();
/** * Loads the given processing instruction in the current sequence. * * @param pi The W3C DOM PI node to load. * * @throws LoadingException If thrown while parsing. */ private void load(ProcessingInstruction pi) throws LoadingException { this.sequence.addEvent(new ProcessingInstructionEvent(pi.getTarget(), pi.getData())); this.currentWeight++; }
result.add(createAttribute(pi, "target", pi.getTarget())); } else if ("data".equals(localName)) { result.add(createAttribute(pi, "data", pi.getData())); } else {
final String data = currentPI.getData();
/** * Serializes an ProcessingInstruction Node. * * @param node The ProcessingInstruction Node to serialize */ protected void serializePI(ProcessingInstruction node) throws SAXException { ProcessingInstruction pi = node; String name = pi.getNodeName(); // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isPIWellFormed(node); } // apply the LSSerializer filter if (!applyFilter(node, NodeFilter.SHOW_PROCESSING_INSTRUCTION)) { return; } // String data = pi.getData(); if (name.equals("xslt-next-is-raw")) { fNextIsRaw = true; } else { this.fSerializer.processingInstruction(name, pi.getData()); } }
/** * Serializes an ProcessingInstruction Node. * * @param node The ProcessingInstruction Node to serialize */ protected void serializePI(ProcessingInstruction node) throws SAXException { ProcessingInstruction pi = node; String name = pi.getNodeName(); // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isPIWellFormed(node); } // apply the LSSerializer filter if (!applyFilter(node, NodeFilter.SHOW_PROCESSING_INSTRUCTION)) { return; } // String data = pi.getData(); if (name.equals("xslt-next-is-raw")) { fNextIsRaw = true; } else { this.fSerializer.processingInstruction(name, pi.getData()); } }
pi.getData());
protected void printPI(ProcessingInstruction instruction, boolean endWithComma) { printIndent(); print("mkp.pi(" + qt); print(instruction.getTarget()); print(qt + ", " + qt); print(instruction.getData()); printEnd(qt + ");", endWithComma); }
pi.getData());
pi.getData());
Character invalidChar = isWFXMLChar(node.getData()); if (invalidChar != null) { String msg =
Character invalidChar = isWFXMLChar(node.getData()); if (invalidChar != null) { String msg =
return createProcessingInstruction(pi.getTarget(), pi.getData());
private void writeProcessingInstruction(final PrintWriter pOut, final ProcessingInstruction pNode) { pOut.print("\n<?"); pOut.print(pNode.getTarget()); String value = pNode.getData(); if (value != null) { pOut.print(" "); pOut.print(value); } pOut.println("?>"); }
/** * This will build a JDOM ProcessingInstruction from an existing DOM ProcessingInstruction * * @param pi <code> org.w3c.dom.ProcessingInstruction</code> object * @return <code>ProcessingInstruction</code> - JDOM ProcessingInstruction object * @since JDOM2 */ public org.jdom2.ProcessingInstruction build(org.w3c.dom.ProcessingInstruction pi) { return factory.processingInstruction(pi.getTarget(), pi.getData()); }