diff options
author | Burak Emir <emir@epfl.ch> | 2005-12-12 10:27:27 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2005-12-12 10:27:27 +0000 |
commit | 5dbdf2cc8cb2b96271b1a8183319592f239173f6 (patch) | |
tree | 52cb3bc16ae79b99a9b9c5dd0bd0dd04a33c1b51 /test/files/jvm/xml01.scala | |
parent | 04fe66b3066a95dadd22e3ebdf3d6a6aafe6e623 (diff) | |
download | scala-5dbdf2cc8cb2b96271b1a8183319592f239173f6.tar.gz scala-5dbdf2cc8cb2b96271b1a8183319592f239173f6.tar.bz2 scala-5dbdf2cc8cb2b96271b1a8183319592f239173f6.zip |
changed test cases for anyvalue attributes
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'); + } + } |