getElement method

XmlElement? getElement({
  1. required XmlElement element,
  2. required String nodePath,
})

获取节点元素值 element XmlElement nodePath 节点路径 eg. root->node1->node2->node3

Implementation

XmlElement? getElement({required XmlElement element, required String nodePath}) {
  if (nodePath.isEmptyString) {
    return null;
  }
  var list = nodePath.split("->");
  var xmlElement = _getNextElement(element, list);
  return xmlElement;
}