summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/files/jvm/xml01.check3
-rw-r--r--test/files/jvm/xml01.scala23
-rw-r--r--test/files/jvm/xmlstuff.scala2
3 files changed, 26 insertions, 2 deletions
diff --git a/test/files/jvm/xml01.check b/test/files/jvm/xml01.check
index 34ce38f67e..dd05157794 100644
--- a/test/files/jvm/xml01.check
+++ b/test/files/jvm/xml01.check
@@ -19,3 +19,6 @@ passed ok
passed ok
passed ok
<book><author>Peter Buneman</author><author>Dan Suciu</author><title>Data on ze web</title></book>
+attribute value normalization
+passed ok
+passed ok
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='&#x015e;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');
+ }
+
}
diff --git a/test/files/jvm/xmlstuff.scala b/test/files/jvm/xmlstuff.scala
index e9db999828..68e207c370 100644
--- a/test/files/jvm/xmlstuff.scala
+++ b/test/files/jvm/xmlstuff.scala
@@ -47,7 +47,7 @@ object Test {
</foo>;
val pelems_1 = for( val x <- p \ "bar"; val y <- p \ "baz" ) yield {
- Text(x.attribute("value") + y.attribute("bazValue")+ "!")
+ Text(x.attribute("value").toString() + y.attribute("bazValue").toString()+ "!")
};
val pelems_2 = new NodeSeq { val theSeq = List(Text("38!"),Text("58!")) };
assertSameElements(pelems_1, pelems_2);