private static Element xppToElement(Xpp3Dom xpp) throws RemoteException { Element result; try { result = new Element(xpp.getName()); } catch (IllegalNameException e) { Maven3ServerGlobals.getLogger().info(e); return null; } Xpp3Dom[] children = xpp.getChildren(); if (children == null || children.length == 0) { result.setText(xpp.getValue()); } else { for (Xpp3Dom each : children) { Element child = xppToElement(each); if (child != null) result.addContent(child); } } return result; }
private static Element xppToElement(Xpp3Dom xpp) throws RemoteException { Element result; try { result = new Element(xpp.getName()); } catch (IllegalNameException e) { Maven2ServerGlobals.getLogger().info(e); return null; } Xpp3Dom[] children = xpp.getChildren(); if (children == null || children.length == 0) { result.setText(xpp.getValue()); } else { for (Xpp3Dom each : children) { Element child = xppToElement(each); if (child != null) result.addContent(child); } } return result; }
private static Element convertXpp(Xpp3Dom xpp3Dom) { Element result; try { result = new Element(xpp3Dom.getName()); } catch (IllegalNameException e) { return null; } Xpp3Dom[] children = xpp3Dom.getChildren(); if (children == null || children.length == 0) { result.setText(xpp3Dom.getValue()); } else { for (Xpp3Dom child : children) { Element element = convertXpp(child); if (element != null) { result.addContent(element); } } } return result; }