summaryrefslogblamecommitdiff
path: root/test/files/xml/lnk.scala
blob: 412f948d99b9d7c402d5bf3f9440e0417030220f (plain) (tree)
1
2
3
4
5
6
7
8
9
10

       
                      






                                                 
                                                                                          


                                       
                                                     
                                                            



                                                     


                                               
                                


   
// $Id$

import scala.xml.Node;
import dtd._;

object Test {

  // 3 ways to construct your data
  def main(args:Array[String]) = {
    // construct data using original Element name
    //val b: Node = dtd._factory.get("link").match { case Some(x) => x(Nil,null)}; // safe
    // !!! System.out.println(b.toXML);

    // construct data using constructor
    val c = Link(Name(scala.xml.Text("hello-link")));
    //c.getAttribs.update("target", "http://www.scala.org");
    System.out.println( c );

    val c2 = c % ('target <= "http://www.scala.org");
    System.out.println( c2 );

    // construct data using loading from a file
    val lnkDB = load(args(0));
    System.out.println( lnkDB );
  }

}