Re: [libxml-devel] Proposed API changes for working with child nodes and attributes

2008-07-08 Thread Sean Chittenden
...I wonder if I still have my patch hanging around for that makes use of method_missing() to find nodes (pretty cool for XML configuration foo). Ah, what's that do? config = XML::Document... @version = config.version bin = config.bin config.path.each do |path| p path end For a document

Re: [libxml-devel] Proposed API changes for working with child nodes and attributes

2008-07-08 Thread Charlie Savage
Thus node.children is a XML::Node that acts both as a single node and also a collection. The same is true for attributes. I wanted to revisit this at some point, I'm glad someone is doing it. Ah good. some_node = doc.find('/foo') child_nodes = some_node.children child_nodes.class == "Array

Re: [libxml-devel] Proposed API changes for working with child nodes and attributes

2008-07-08 Thread Sean Chittenden
I've noticed two oddities in the libxml api - dealing with child elements and attributes. In both cases, the returned value is a single item (an attribute or node) that then provides methods to get to the next item. So: some_node = doc.find('/foo') child = some_node.children while child

[libxml-devel] Proposed API changes for working with child nodes and attributes

2008-07-08 Thread Charlie Savage
I've noticed two oddities in the libxml api - dealing with child elements and attributes. In both cases, the returned value is a single item (an attribute or node) that then provides methods to get to the next item. So: some_node = doc.find('/foo') child = some_node.children while child .