4

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

Jacob Schoen
  • 14,034
  • 15
  • 82
  • 102
laxmi
  • 865
  • 6
  • 17
  • 27

1 Answers1

3

Use any of:

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

Backslash is an escape character.

Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674
  • Hi can you please look at a similar [question here?](http://stackoverflow.com/questions/10278530/read-a-xml-file-in-groovy) – AabinGunz Apr 23 '12 at 10:17