| 1434 | |
| 1435 | // Find the ns:elem elements and check their URIs |
| 1436 | function findElement( |
| 1437 | children: readonly import("./types.ts").XmlNode[], |
| 1438 | name: string, |
| 1439 | ): import("./types.ts").XmlElement | undefined { |
| 1440 | for (const child of children) { |
| 1441 | if (child.type === "element") { |
| 1442 | if (child.name.local === name) return child; |
| 1443 | const found = findElement(child.children, name); |
| 1444 | if (found) return found; |
| 1445 | } |
| 1446 | } |
| 1447 | return undefined; |
| 1448 | } |
| 1449 | |
| 1450 | const elem1 = findElement(doc.root.children, "elem1"); |
| 1451 | const elem2 = findElement(doc.root.children, "elem2"); |