Exemple #1
0
  public XmlElement[] getChildByName(String ns, String name) throws MbException {
    // TODO change to XPath impl

    MbElement child = getMbElement().getFirstChild();

    List childList = new ArrayList();
    while (child != null) {
      if (name.equals(child.getName())) {
        if (ns != null && ns.equals(child.getNamespace())) {
          childList.add(new XmlElement(child, isReadOnly()));
        }
      }

      child = child.getNextSibling();
    }

    return (XmlElement[]) childList.toArray(new XmlElement[0]);
  }