I have the following string i loaded by typesafe ConfigFactory.
Conf.conf:
xpath {
test = """"region"/"city"/"street"/"apartment""""
}
Then i convert it to suitable format (back slash to forward slash "region"\"city"\"street"\"apartment"):
val conf = ConfigFactory.load("Conf.conf").getString("xpath.test")
val test = conf.replace("/","\\")
I have XML file:
val xml_file = XML.load("PATHtoXML")
so that to further find value of "test" in "xml_file". In general it works like : (xml_file \ "xx" \ "yyy" \ "dddd").text. However I'm stuck to getting value in my case:
val res = (xml_file \\ test).text
println(s"Result -> ${res}")
it returns nothing.
Would you please give me some hints to solve it.
many thanks!