List of utility methods to do XML Node Value
String | xmlNodeGetValue(Node node) Xml node get value. NodeList list = node.getChildNodes(); int len = list.getLength(); if (len > 1) System.err.println(" Error: length of node=" + len + " for tag <" + node.getNodeName() + ">"); for (int i = 0; i < len; i++) { Node n = list.item(i); if (n.getNodeType() == Node.TEXT_NODE) { return (n.getNodeValue()); ... |
Object | xmlToBean(Node beanNode) xml To Bean String className = beanNode.getNodeName(); System.out.println(className); Class clazz = Class.forName(className); Object bean = clazz.newInstance(); NodeList fieldNodeList = beanNode.getChildNodes(); for (int i = 0; i < fieldNodeList.getLength(); i++) { Node fieldNode = fieldNodeList.item(i); if (fieldNode.getNodeType() == Node.ELEMENT_NODE) { ... |