如何使用 Ruby 提取碎片化 XML 文档的节点名称? [英] How can I extract the node names for fragmented XML document using Ruby?

查看:51
本文介绍了如何使用 Ruby 提取碎片化 XML 文档的节点名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个类似 XML 的文档,它由我无法控制的系统进行预处理.文档的格式是这样的:

I an XML-like document which is pre-processed by a system out of my control. The format of the document is like this:

 <template>
Hello, there <RECALL>first_name</RECALL>.  Thanks for giving me your email.  
<SETPROFILE><NAME>email</NAME><VALUE><star/></VALUE></SETPROFILE>.  I have just sent you something.
</template>

但是,我只能将