diff options
Diffstat (limited to 'test/files/jvm/xml01.scala')
-rw-r--r-- | test/files/jvm/xml01.scala | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/test/files/jvm/xml01.scala b/test/files/jvm/xml01.scala index a0ea59408c..1e54ae9e19 100644 --- a/test/files/jvm/xml01.scala +++ b/test/files/jvm/xml01.scala @@ -177,7 +177,28 @@ object Test { Console.println( (parsedxml2 \\ "book" ){ n:Node => n \ "title" == "Data on ze web" } - ) + ); + + // test unicode escapes backslash u + + Console println ("attribute value normalization"); + val xmlAttrValueNorm = "<personne id='p0003' nom='Şahingöz' />"; + { + val isrcA = new InputSource( new StringReader(xmlAttrValueNorm) ); + val parsedxmlA = XML.load(isrcA); + val c = (parsedxmlA \ "@nom").text.charAt(0); + //Console.println("char '"+c+"' \u015e"); + assertTrue(c == '\u015e'); + } + { + val isr = scala.io.Source.fromString(xmlAttrValueNorm); + val pxmlB = scala.xml.parsing.ConstructingParser.fromSource(isr,false); + val parsedxmlB = pxmlB.element(TopScope); + val c = (parsedxmlB \ "@nom").text.charAt(0); + //Console.println("char '"+c+"' \u015e"); + assertTrue(c == '\u015e'); + } + } |