문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top