P
Peter Bailey
Hello,
I'm finally using REXML instead of plain vanilla Ruby to convert XML
data. I've learned a bit about XPath and how REXML can use it. I've got
a sample XML file whose root element is <registration>. Underneath that
element are a bunch of children elements. So, when I do the instruction
listed below, I get all of them. But, I don't get the last two elements
that, to me anyway, are children, too. The only thing different about
them is that they have children, too. Does anyone know the nomenclature
for getting ALL of the children of an element, not just those that are
immediate children. I guess I want grandkids, too!
XPath.each(doc, "//registration/*") { |element| puts element.text }
Thanks,
Peter
I'm finally using REXML instead of plain vanilla Ruby to convert XML
data. I've learned a bit about XPath and how REXML can use it. I've got
a sample XML file whose root element is <registration>. Underneath that
element are a bunch of children elements. So, when I do the instruction
listed below, I get all of them. But, I don't get the last two elements
that, to me anyway, are children, too. The only thing different about
them is that they have children, too. Does anyone know the nomenclature
for getting ALL of the children of an element, not just those that are
immediate children. I guess I want grandkids, too!
XPath.each(doc, "//registration/*") { |element| puts element.text }
Thanks,
Peter