envex
1
Hello,
I have problem using XMLsimple.xml_in with ‘&’ character :
&
Illegal character ‘&’ in raw string “&”
The problem is solved when I replace ‘&’ by ‘&’
but when I this
#####################################
test = XmlSimple.xml_in(“test.xml”)
test[“visit”].each { |visit|
puts visit[“job”]
}
######################################
that puts me ‘&’ and not ‘&’…
To be simple, I juste want to have string with & in my xml file and &
when I puts them after loading.
Thanks for your help.
envex
2
Matt V. wrote:
The problem is solved when I replace ‘&’ by ‘&’
maybe try &
^
Cheers,
Peter
http://www.rubyrailways.com
http://scrubyt.org
envex
3
Peter S. wrote:
Matt V. wrote:
The problem is solved when I replace ‘&’ by ‘&’
maybe try &
^
That’s works fine thanks!
But Why & didn’t raised me the same Illegal character error ?
^
envex
4
On Oct 11, 4:50 am, Matt V. [email protected] wrote:
To be simple, I juste want to have string with & in my xml file and &
when I puts them after loading.
Your xml file must wrap your data in CDATA tags in order for you to
use the raw characters. Change your xml file to look like this:
Enjoy!