/** Get the trimed text content of a node or null if there is no text */ public static String getContent(Node n ) { if( n==null ) return null; Node n1=DomUtil.getChild(n, Node.TEXT_NODE); if( n1==null ) return null; String s1=n1.getNodeValue(); return s1.trim(); }
/** Get the trimmed text content of a node or null if there is no text */ public static String getContent(Node n ) { if( n==null ) return null; Node n1=DomUtil.getChild(n, Node.TEXT_NODE); if( n1==null ) return null; String s1=n1.getNodeValue(); return s1.trim(); }
/** Get the trimmed text content of a node or null if there is no text */ public static String getContent(Node n ) { if( n==null ) return null; Node n1=DomUtil.getChild(n, Node.TEXT_NODE); if( n1==null ) return null; String s1=n1.getNodeValue(); return s1.trim(); }
/** Get the trimmed text content of a node or null if there is no text */ public static String getContent(Node n ) { if( n==null ) return null; Node n1=DomUtil.getChild(n, Node.TEXT_NODE); if( n1==null ) return null; String s1=n1.getNodeValue(); return s1.trim(); }
/** Get the trimed text content of a node or null if there is no text */ public static String getContent(Node n ) { if( n==null ) return null; Node n1=DomUtil.getChild(n, Node.TEXT_NODE); if( n1==null ) return null; String s1=n1.getNodeValue(); return s1.trim(); }
/** Get the trimed text content of a node or null if there is no text */ public static String getContent(Node n ) { if( n==null ) return null; Node n1=DomUtil.getChild(n, Node.TEXT_NODE); if( n1==null ) return null; String s1=n1.getNodeValue(); return s1.trim(); }
/** Set or replace the text value */ public static void setText(Node node, String val) { Node chld=DomUtil.getChild(node, Node.TEXT_NODE); if( chld == null ) { Node textN=node.getOwnerDocument().createTextNode(val); node.appendChild(textN); return; } // change the value chld.setNodeValue(val); }
/** Set or replace the text value */ public static void setText(Node node, String val) { Node chld=DomUtil.getChild(node, Node.TEXT_NODE); if( chld == null ) { Node textN=node.getOwnerDocument().createTextNode(val); node.appendChild(textN); return; } // change the value chld.setNodeValue(val); }
/** Set or replace the text value */ public static void setText(Node node, String val) { Node chld=DomUtil.getChild(node, Node.TEXT_NODE); if( chld == null ) { Node textN=node.getOwnerDocument().createTextNode(val); node.appendChild(textN); return; } // change the value chld.setNodeValue(val); }
/** Set or replace the text value */ public static void setText(Node node, String val) { Node chld=DomUtil.getChild(node, Node.TEXT_NODE); if( chld == null ) { Node textN=node.getOwnerDocument().createTextNode(val); node.appendChild(textN); return; } // change the value chld.setNodeValue(val); }
/** Set or replace the text value */ public static void setText(Node node, String val) { Node chld=DomUtil.getChild(node, Node.TEXT_NODE); if( chld == null ) { Node textN=node.getOwnerDocument().createTextNode(val); node.appendChild(textN); return; } // change the value chld.setNodeValue(val); }
/** Set or replace the text value */ public static void setText(Node node, String val) { Node chld=DomUtil.getChild(node, Node.TEXT_NODE); if( chld == null ) { Node textN=node.getOwnerDocument().createTextNode(val); node.appendChild(textN); return; } // change the value chld.setNodeValue(val); }
/** Find the first direct child with a given attribute. * @param parent * @param elemName name of the element, or null for any * @param attName attribute we're looking for * @param attVal attribute value or null if we just want any */ public static Node findChildWithAtt(Node parent, String elemName, String attName, String attVal) { Node child=DomUtil.getChild(parent, Node.ELEMENT_NODE); if( attVal== null ) { while( child!= null && ( elemName==null || elemName.equals( child.getNodeName())) && DomUtil.getAttribute(child, attName) != null ) { child=getNext(child, elemName, Node.ELEMENT_NODE ); } } else { while( child!= null && ( elemName==null || elemName.equals( child.getNodeName())) && ! attVal.equals( DomUtil.getAttribute(child, attName)) ) { child=getNext(child, elemName, Node.ELEMENT_NODE ); } } return child; }
/** Find the first direct child with a given attribute. * @param parent * @param elemName name of the element, or null for any * @param attName attribute we're looking for * @param attVal attribute value or null if we just want any */ public static Node findChildWithAtt(Node parent, String elemName, String attName, String attVal) { Node child=DomUtil.getChild(parent, Node.ELEMENT_NODE); if( attVal== null ) { while( child!= null && ( elemName==null || elemName.equals( child.getNodeName())) && DomUtil.getAttribute(child, attName) != null ) { child=getNext(child, elemName, Node.ELEMENT_NODE ); } } else { while( child!= null && ( elemName==null || elemName.equals( child.getNodeName())) && ! attVal.equals( DomUtil.getAttribute(child, attName)) ) { child=getNext(child, elemName, Node.ELEMENT_NODE ); } } return child; }
private void processArg(Node mbeanN) { Node firstArgN=DomUtil.getChild(mbeanN, "arg" ); // process all args for (Node argN = firstArgN; argN != null; argN = DomUtil.getNext( argN )) { String type=DomUtil.getAttribute(argN, "type"); String value=DomUtil.getAttribute(argN, "value"); if( value==null ) { // The value may be specified as CDATA value=DomUtil.getContent(argN); } } } }
private void processArg(Node mbeanN) { Node firstArgN=DomUtil.getChild(mbeanN, "arg" ); // process all args for (Node argN = firstArgN; argN != null; argN = DomUtil.getNext( argN )) { DomUtil.getAttribute(argN, "type"); String value=DomUtil.getAttribute(argN, "value"); if( value==null ) { // The value may be specified as CDATA value=DomUtil.getContent(argN); } } } }
private void processArg(Node mbeanN) { Node firstArgN=DomUtil.getChild(mbeanN, "arg" ); // process all args for (Node argN = firstArgN; argN != null; argN = DomUtil.getNext( argN )) { String type=DomUtil.getAttribute(argN, "type"); String value=DomUtil.getAttribute(argN, "value"); if( value==null ) { // The value may be specified as CDATA value=DomUtil.getContent(argN); } } } }
private void processArg(Node mbeanN) { Node firstArgN=DomUtil.getChild(mbeanN, "arg" ); // process all args for (Node argN = firstArgN; argN != null; argN = DomUtil.getNext( argN )) { DomUtil.getAttribute(argN, "type"); String value=DomUtil.getAttribute(argN, "value"); if( value==null ) { // The value may be specified as CDATA value=DomUtil.getContent(argN); } } } }
private void processArg(Node mbeanN) { Node firstArgN=DomUtil.getChild(mbeanN, "arg" ); // process all args for (Node argN = firstArgN; argN != null; argN = DomUtil.getNext( argN )) { DomUtil.getAttribute(argN, "type"); String value=DomUtil.getAttribute(argN, "value"); if( value==null ) { // The value may be specified as CDATA value=DomUtil.getContent(argN); } } } }
private void processArg(Node mbeanN) { Node firstArgN=DomUtil.getChild(mbeanN, "arg" ); // process all args for (Node argN = firstArgN; argN != null; argN = DomUtil.getNext( argN )) { String type=DomUtil.getAttribute(argN, "type"); String value=DomUtil.getAttribute(argN, "value"); if( value==null ) { // The value may be specified as CDATA value=DomUtil.getContent(argN); } } } }