XML::DOM::NodeList(3)

XML::DOM::NodeList πŸ’…

okay bestie, this is the manual page for XML::DOM::NodeList(3) β€” the whole vibe is β€œa node list as used by XML::DOM.” pull up a chair, we’re getting into it ✨

✨ NAME ✨

XML::DOM::NodeList β€” A node list as used by XML::DOM.

πŸ’– DESCRIPTION πŸ’–

The NodeList interface gives you the abstraction of an ordered collection of nodes, and it does not define or constrain how that collection is actually implemented. no cap, it’s just the interface vibe πŸ’«

The items in the NodeList are accessible via an integral index, starting from 0. zero-based indexing girlies rise 🫢

Although the DOM spec states that all NodeLists are β€œlive” in that they allways reflect changes to the DOM tree, the NodeList returned by getElementsByTagName is not live in this implementation. See CAVEATS for details. yes, this is the plot twist 😭

🌸 METHODS 🌸

  • item (index) β€” Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns undef. so if you ask for too much, you get nothing β€” literally πŸ’€
  • getLength β€” The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive. math girlies we love to see it πŸ”₯

πŸŽ€ Additional methods not in the DOM Spec πŸŽ€

  • dispose β€” Removes all circular references in this NodeList and its descendants so the objects can be claimed for garbage collection. The objects should not be used afterwards. like, after dispose, leave them alone fr fr πŸ™ˆ

πŸ’– cute little sign-off πŸ’–

this iconic little page is XML::DOM::NodeList(3), from perl v5.42.0, dated 2022-05-23. periodt πŸ’…βœ¨

πŸ“¦ where this page comes from