(elList, plainNodes)
| 2836 | |
| 2837 | // Only retrieve the value of the given attrName. |
| 2838 | function retrieve(elList, plainNodes) { |
| 2839 | var anySatisfied = false; |
| 2840 | for (var i = 0; i < elList.length; i++) { |
| 2841 | var el = elList[i]; |
| 2842 | |
| 2843 | var thisElSatisfied = !opt.filter || opt.filter(el); |
| 2844 | |
| 2845 | var plainNode = {}; |
| 2846 | |
| 2847 | copyElment(plainNode, el); |
| 2848 | |
| 2849 | var textContent = el.getTextContent(); |
| 2850 | if (textContent) { |
| 2851 | plainNode.textContent = {}; |
| 2852 | copyElment(plainNode.textContent, textContent); |
| 2853 | } |
| 2854 | |
| 2855 | var thisSubAnySatisfied = false; |
| 2856 | if (el.isGroup) { |
| 2857 | plainNode.children = []; |
| 2858 | thisSubAnySatisfied = retrieve(el.childrenRef(), plainNode.children); |
| 2859 | } |
| 2860 | |
| 2861 | if (thisElSatisfied || thisSubAnySatisfied) { |
| 2862 | plainNodes.push(plainNode); |
| 2863 | anySatisfied = true; |
| 2864 | } |
| 2865 | } |
| 2866 | |
| 2867 | return anySatisfied; |
| 2868 | } |
| 2869 | |
| 2870 | function copyElment(plainNode, el) { |
| 2871 | for (var i = 0; i < attrNameList.length; i++) { |
no test coverage detected
searching dependent graphs…