public String getProcessingInstructionTarget(Object o) { return (o instanceof ProcessingInstruction ? ((ProcessingInstruction)o).getTarget() : null); }
public String getProcessingInstructionData(Object o) { return (o instanceof ProcessingInstruction ? ((ProcessingInstruction)o).getValue() : null); }
ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet", "href=\"" + STYLESHEET_NAME + "\" type=\"text/xsl\""); xmlDoc.insertChild(pi, 0);
public Nodes makeProcessingInstruction(String target, String data) { flush(); try { serializer.write(new ProcessingInstruction(target, data)); } catch (IOException e) { throw new RuntimeException(e); } return NONE; }
public Nodes makeProcessingInstruction(String target, String data) { flush(); try { serializer.write(new ProcessingInstruction(target, data)); } catch (IOException e) { throw new RuntimeException(e); } return NONE; }
/** compare non-element nodes. * not yet tuned for normalizing adjacent CDATA and other horrors * @param refNode * @param testNode * @param xpath current ancestry of refNode * @return */ public static String compareNonElementNodesCanonically(Node refNode, Node testNode, String xpath) { String message = null; String refValue = refNode.getValue(); String testValue = testNode.getValue(); if (refNode instanceof Comment) { if (!refValue.equals(testValue)) { message = "comments at ("+xpath+") differ: "+refValue+" != "+testValue; } } else if (refNode instanceof Text) { if (!refValue.equals(testValue)) { message = "text contents at ("+xpath+") differ: ["+refValue+"] != ["+testValue+"]"; } } else if (refNode instanceof ProcessingInstruction) { String refTarget = ((ProcessingInstruction) refNode).getTarget(); String testTarget = ((ProcessingInstruction) testNode).getTarget(); if (!refTarget.equals(testTarget)) { message = "PI targets at ("+xpath+") differ: "+refTarget+" != "+testTarget; } } else { LOG.warn("Unknown XML element in comparison"); } return message; }
private ProcessingInstruction readProcessingInstruction(ArrayByteList src) { int type = src.get(src.position() - 1); String target = readString(src, 4, type); String value = readString(src, 6, type); return new ProcessingInstruction(target, value); }
/** * Get the display name of this node. For elements and attributes this is * [prefix:]localname. For unnamed nodes, it is an empty string. * * @return The display name of this node. For a node with no name, return an * empty string. */ public String getDisplayName() { switch (nodeKind) { case Type.ELEMENT: return ((Element) node).getQualifiedName(); case Type.ATTRIBUTE: return ((Attribute) node).getQualifiedName(); case Type.PROCESSING_INSTRUCTION: return ((ProcessingInstruction) node).getTarget(); default: return ""; } }
private ProcessingInstruction readProcessingInstruction(ArrayByteList src) { int type = src.get(src.position() - 1); String target = readString(src, 4, type); String value = readString(src, 6, type); return new ProcessingInstruction(target, value); }
/** * Get the display name of this node. For elements and attributes this is * [prefix:]localname. For unnamed nodes, it is an empty string. * * @return The display name of this node. For a node with no name, return an * empty string. */ public String getDisplayName() { switch (nodeKind) { case Type.ELEMENT: return ((Element) node).getQualifiedName(); case Type.ATTRIBUTE: return ((Attribute) node).getQualifiedName(); case Type.PROCESSING_INSTRUCTION: return ((ProcessingInstruction) node).getTarget(); default: return ""; } }
public void write(IChemObject object) throws CDKException { try { ProcessingInstruction processingInstruction = new ProcessingInstruction("xml-stylesheet", "href=\"http://www.w3.org/2000/08/w3c-synd/style.css\" type=\"text/css\""); Element rdfElement = new Element("rdf:RDF", NS_RDF);
/** * Get the local part of the name of this node. This is the name after the * ":" if any. * * @return the local part of the name. For an unnamed node, returns "". */ public String getLocalPart() { switch (nodeKind) { case Type.ELEMENT: return ((Element) node).getLocalName(); case Type.ATTRIBUTE: return ((Attribute) node).getLocalName(); case Type.PROCESSING_INSTRUCTION: return ((ProcessingInstruction) node).getTarget(); default: return ""; } }
public void write(IChemObject object) throws CDKException { try { ProcessingInstruction processingInstruction = new ProcessingInstruction("xml-stylesheet", "href=\"http://www.w3.org/2000/08/w3c-synd/style.css\" type=\"text/css\""); Element rdfElement = new Element("rdf:RDF", NS_RDF);
/** * Get the local part of the name of this node. This is the name after the * ":" if any. * * @return the local part of the name. For an unnamed node, returns "". */ public String getLocalPart() { switch (nodeKind) { case Type.ELEMENT: return ((Element) node).getLocalName(); case Type.ATTRIBUTE: return ((Attribute) node).getLocalName(); case Type.PROCESSING_INSTRUCTION: return ((ProcessingInstruction) node).getTarget(); default: return ""; } }
ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet", "href=\"" + STYLESHEET_NAME + "\" type=\"text/xsl\""); xmlDoc.insertChild(pi, 0);
/** * Get the local part of the name of this node. This is the name after the * ":" if any. * * @return the local part of the name. For an unnamed node, returns "". */ public String getLocalPart() { switch (nodeKind) { case Type.ELEMENT: return ((Element) node).getLocalName(); case Type.ATTRIBUTE: return ((Attribute) node).getLocalName(); case Type.PROCESSING_INSTRUCTION: return ((ProcessingInstruction) node).getTarget(); default: return ""; } }
ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet", "href=\"" + STYLESHEET_NAME + "\" type=\"text/xsl\""); xmlDoc.insertChild(pi, 0);
/** * Get the display name of this node. For elements and attributes this is * [prefix:]localname. For unnamed nodes, it is an empty string. * * @return The display name of this node. For a node with no name, return an * empty string. */ public String getDisplayName() { switch (nodeKind) { case Type.ELEMENT: return ((Element) node).getQualifiedName(); case Type.ATTRIBUTE: return ((Attribute) node).getQualifiedName(); case Type.PROCESSING_INSTRUCTION: return ((ProcessingInstruction) node).getTarget(); default: return ""; } }