changeset 30:60dcb4210a48

~ easy test of saxon main method
author Alexandre Bertails <bertails@w3.org>
date Tue, 09 Aug 2011 13:50:45 -0400
parents 1c98f0a6d38e
children 5cea090725d9
files src/test/scala/Test.scala
diffstat 1 files changed, 8 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/test/scala/Test.scala	Tue Aug 09 11:27:00 2011 -0400
+++ b/src/test/scala/Test.scala	Tue Aug 09 13:50:45 2011 -0400
@@ -14,36 +14,19 @@
 
   ResponseCache.setDefault(URLResolver("/home/betehess/W3C"))
 
-  ("") {
+  test("") {
 
-    // Transform.main(Array("-s:http://www.w3.org/TR/2011/CR-WOFF-20110804/",
-    //                      "-xsl:http://www.w3.org/2001/10/trdoc2rdf.xslt",
-    //                      "-o:/tmp/toto.xml"))
-
-
-
-    val s = "http://www.w3.org/TR/2011/CR-WOFF-20110804/"
-    val xsl = "http://www.w3.org/2001/10/trdoc2rdf.xslt"
+    val s = "http://www.w3.org/TR/2011/WD-turtle-20110809/"
+//    val xsl = "http://www.w3.org/2001/10/trdoc2rdf.xslt"
+//    val xsl = "http://www.w3.org/2005/07/13-pubrules.xsl"
+    val xsl = "http://www.w3.org/2005/09/checker/frame.xsl"
     val o = "/tmp/toto2.xml"
 
-    val proc:Processor = new Processor(false)
-    val comp:XsltCompiler = proc.newXsltCompiler()
-    val xsltStreamSource = new StreamSource(new URL(xsl).openStream())
-    xsltStreamSource.setSystemId(xsl)
-    val exp:XsltExecutable = comp.compile(xsltStreamSource)
-    val source:XdmNode = proc.newDocumentBuilder().build(new StreamSource(new URL(s).openStream()))
-    val out:Serializer = new Serializer()
-    out.setOutputProperty(Serializer.Property.METHOD, "html")
-    out.setOutputProperty(Serializer.Property.INDENT, "yes")
-    out.setOutputFile(new File(o))
-    val trans:XsltTransformer = exp.load()
-    trans.setInitialContextNode(source)
-    trans.setDestination(out)
-    trans.transform()
+    Transform.main(Array("-s:"+s,
+                         "-xsl:"+xsl,
+                         "-o:"+o))
 
-    println("Output written to books.html")
 
-    1
   }
 
 }
Set up and maintained by W3C Systems Team, please report bugs to sysreq@w3.org.

W3C would like to thank Microsoft who donated the server that allows us to run this service.