diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/xml/lnk.check | 1 | ||||
-rw-r--r-- | test/files/xml/lnk.scala | 22 |
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 "What is LDAP"</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 ); |