summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorburaq <buraq@epfl.ch>2004-06-29 09:31:48 +0000
committerburaq <buraq@epfl.ch>2004-06-29 09:31:48 +0000
commitd2db0dc89df674a898c0eb0aee69bc326e74dfd6 (patch)
tree70ee3dc1d64bcee8ecff0cd27823b4e429f42b8c /test
parentd4e3c78e738e37a0ba5fa5eb8b5196a8556d2c53 (diff)
downloadscala-d2db0dc89df674a898c0eb0aee69bc326e74dfd6.tar.gz
scala-d2db0dc89df674a898c0eb0aee69bc326e74dfd6.tar.bz2
scala-d2db0dc89df674a898c0eb0aee69bc326e74dfd6.zip
namespace fix + more validation
Diffstat (limited to 'test')
-rw-r--r--test/files/xml/lnk.check1
-rw-r--r--test/files/xml/lnk.scala22
2 files changed, 22 insertions, 1 deletions
diff --git a/test/files/xml/lnk.check b/test/files/xml/lnk.check
index e7dca84cc8..23312a819c 100644
--- a/test/files/xml/lnk.check
+++ b/test/files/xml/lnk.check
@@ -1,3 +1,4 @@
+validator throws exception: element "link" not allowed here
<link target="http://www.scala.org" xmlns="http://scala.epfl.ch/testSuite/links"><name>hello-link</name></link>
<lnkDB xmlns="http://scala.epfl.ch/testSuite/links"><linkgroup><groupname>LDAP Links</groupname><link target="http://www.openldap.org/doc/"><name>OpenLDAP Administration Guide</name><description>contains very readable section &quot;What is LDAP&quot;</description></link><linkgroup><groupname>LDAP RFCs</groupname><link target="ftp://ftp.isi.edu/in-notes/rfc2251.txt"><name>RFC2251 Lightweight Directory Access Protocol (v3)</name></link><link target="ftp://ftp.isi.edu/in-notes/rfc2252.txt"><name>Lightweight Directory Access Protocol (v3):
Attribute Syntax Definitions</name></link><link target="ftp://ftp.isi.edu/in-notes/rfc2253.txt"><name>Lightweight Directory Access Protocol (v3):
diff --git a/test/files/xml/lnk.scala b/test/files/xml/lnk.scala
index 8d81eae609..7d4c927efe 100644
--- a/test/files/xml/lnk.scala
+++ b/test/files/xml/lnk.scala
@@ -13,13 +13,33 @@ object Test {
//val b: Node = dtd._factory.get("link").match { case Some(x) => x(Nil,null)}; // safe
// !!! System.out.println(b.toXML);
- // construct data using constructor
+ // construct data using constructor (valid)
val c = Link(
new AttributeSeq(
Attribute("","target","http://www.scala.org")
),
Name(n, scala.xml.Text("hello-link"))
);
+
+ try {
+ val c2 = Name(
+ n,
+ Link( n )
+ );
+ Console.println("eh ?");
+ } catch {
+ case scala.xml.dtd.ValidationException(msg) => {
+ Console.print("validator throws exception: ");
+ Console.println( msg );
+ }
+ case z => // ignore
+ Console.println("whut??? "+z.getClass);
+
+ }
+
+
+
+
//c.getAttribs.update("target", "http://www.scala.org");
System.out.println( c );