开发者

How to read XML file in groovy?

开发者 https://www.devze.com 2023-03-08 09:56 出处:网络
I am trying to read XML file in groovy with below开发者_运维问答 lines of code def xml=new XmlSlurper().parse(\"C:\\2011XmlLog20110524_0623\")

I am trying to read XML file in groovy with below开发者_运维问答 lines of code

def xml=new XmlSlurper().parse("C:\2011XmlLog20110524_0623")  
xml.Document.BillID.each{   
println it}

I am getting file not found error though i have the file in my C drive..is there any syntax mistake there?..

With advance thanks,

Laxmi


Use any of:

  • "C:/2011XmlLog20110524_0623"
  • "C:\\2011XmlLog20110524_0623"

Backslash is an escape character.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号