在groovy中解析多个XML标记并插入到Oracle db中

在groovy中解析多个XML标记并插入到Oracle db中,groovy,xml-parsing,Groovy,Xml Parsing,我需要递归地读取XML中的多个标记。我在Groovy中用ODI编写了这段代码,它不会给出任何错误,也不会给出任何输出。它应该在我的数据库中插入2行来查看xml,但它没有插入。似乎标签的层次结构有问题。请帮帮我 xml文件: groovy代码: File SFDCResponseFile = new File("/drxe2o/admin/Integration/odi/reference_data/sfdc/copy_center/Sample.xml") if (!SFDC

我需要递归地读取XML中的多个标记。我在Groovy中用ODI编写了这段代码,它不会给出任何错误,也不会给出任何输出。它应该在我的数据库中插入2行来查看xml,但它没有插入。似乎标签的层次结构有问题。请帮帮我

xml文件:

groovy代码:

 File SFDCResponseFile = new File("/drxe2o/admin/Integration/odi/reference_data/sfdc/copy_center/Sample.xml")
        if (!SFDCResponseFile?.exists()) {
            throw new RuntimeException("No SFDC Query Response file ${SFDCResponseFile.absolutePath}")
        }

   def myCon = odiRef.getJDBCConnection("SRC")
   def myStmt = myCon.createStatement()

    def slurper = new XmlSlurper().parse(SFDCResponseFile)

slurper.queryResponse.result.records.each
{
            myStmt.executeUpdate("INSERT INTO <%=odiRef.getSchemaNameDefaultPSchema("LS_ODI_WORK","D")%>.RX_ODI_TAGVALUE_TEMP " +
                "(EVENT_CODE,EVENT_EDITION,ORDER_SUMMARY_NUMBER) " +
                "VALUES ('${it.Event_Code__c.text()}','${it.Event_Edition__c.text()}','${it.Order_Summary_Number__c.text()}')")
}
File SFDCResponseFile=新文件(“/drxe2o/admin/Integration/odi/reference\u data/sfdc/copy\u center/Sample.xml”)
如果(!SFDCResponseFile?.exists()){
抛出新的运行时异常(“无SFDC查询响应文件${SFDCResponseFile.absolutePath}”)
}
def myCon=odiRef.getJDBCConnection(“SRC”)
def myStmt=myCon.createStatement()
def slurper=new XmlSlurper().parse(SFDCResponseFile)
slurper.queryResponse.result.records.each
{
myStmt.executeUpdate(“插入到.RX\u ODI\u TAGVALUE\u TEMP”+
(事件代码、事件版本、订单摘要编号)+
“值('${it.Event_Code_uc.text()}'、'${it.Event_Edition_uc.text()}'、'${it.Order_Summary_Number_uc.text()}'))
}

是否检查了查询字符串是否正确。。?因为看起来您可能无法从双引号和xml文件而不是图像中转义。您能否提供
Sample.xml
文件的内容?