Closed satoren closed 2 months ago
The changes introduce new functionality in the Yex.XmlElement
and Yex.XmlFragment
modules by adding a children/1
function to both, allowing for the retrieval of child elements in a structured manner. Additionally, new test cases validate the functionality of the children/1
method in both modules, enhancing test coverage and ensuring correct behavior when handling multiple XML elements.
Files | Change Summary |
---|---|
lib/shared_type/xml_element.ex |
Added alias for Yex.Xml and public function children/1 , which returns an enumerable stream of child elements. |
lib/shared_type/xml_fragment.ex |
Added alias for Yex.Xml and public function children/1 , which returns an enumerable stream of child nodes. |
test/shared_type/xml_element_test.exs |
Introduced a new test case for the children/1 function, verifying the correct child count after multiple inserts. |
test/shared_type/xml_fragment_test.exs |
Modified XML fragment fetching and added a new test case for the children/1 function, validating child count. |
sequenceDiagram
participant User
participant XmlElement
participant XmlFragment
User->>XmlElement: Call children(xml_element)
XmlElement->>XmlElement: Stream.unfold to get child elements
XmlElement->>User: Return enumerable stream of children
User->>XmlFragment: Call children(xml_fragment)
XmlFragment->>XmlFragment: Stream.unfold to get child nodes
XmlFragment->>User: Return enumerable stream of children
🐇 In the garden where XML grows,
New paths for children, as everyone knows.
With streams of elements, hopping along,
The structure is clearer, the code sings a song.
Let's celebrate changes, both big and small,
For each little child, we cherish them all! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
children
function in both theXmlElement
andXmlFragment
modules for retrieving child elements in a structured manner.children
methods in bothXmlElement
andXmlFragment
, enhancing overall test coverage.