From 234eb8893c689f3f8d847bc4098b693a723c4886 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Mon, 27 Nov 2000 17:08:55 +0000 Subject: [PATCH] xaland that uses DOM created, but seems to be bugged and not working --- helm/xsltd/Makefile | 8 ++ helm/xsltd/xaland-java-DOM/xaland_DOM.class | Bin 0 -> 3555 bytes helm/xsltd/xaland-java-DOM/xaland_DOM.java | 91 ++++++++++++++++++++ helm/xsltd/xaland-java/xaland.java | 9 -- helm/xsltd/xaland_DOM.class | Bin 0 -> 3555 bytes 5 files changed, 99 insertions(+), 9 deletions(-) create mode 100644 helm/xsltd/xaland-java-DOM/xaland_DOM.class create mode 100644 helm/xsltd/xaland-java-DOM/xaland_DOM.java create mode 100644 helm/xsltd/xaland_DOM.class diff --git a/helm/xsltd/Makefile b/helm/xsltd/Makefile index 83c51d9d5..794aa2310 100644 --- a/helm/xsltd/Makefile +++ b/helm/xsltd/Makefile @@ -6,6 +6,14 @@ start-xaland: $(HELM_STYLES_DIR)/theory_content.xsl \ $(HELM_STYLES_DIR)/theory_pres.xsl +start-xaland-DOM: + java -ss1024K -oss8192K \ + xaland_DOM 12345 12346 \ + $(HELM_STYLES_DIR)/rootcontent.xsl \ + $(HELM_STYLES_DIR)/annotatedpres.xsl \ + $(HELM_STYLES_DIR)/theory_content.xsl \ + $(HELM_STYLES_DIR)/theory_pres.xsl + start-xaland-2: java -ss1024K -oss8192K \ xaland2 12345 12346 \ diff --git a/helm/xsltd/xaland-java-DOM/xaland_DOM.class b/helm/xsltd/xaland-java-DOM/xaland_DOM.class new file mode 100644 index 0000000000000000000000000000000000000000..59c9683c9c09b9358475aa3f6416ac0488cc37a4 GIT binary patch literal 3555 zcma)9>vtPh5&vCT_O91^99y<*Z=9sctJrE{HE!d!n-@-;)DH3k%Q1FBNY>KYRw`-L z-IZ&%yeUv#rO?A8a0rxFN})gsmEtOtS9z5;gir7f@D)DxoE&C$Wm~T8bJ!1a=g!QX znLBr8_TJa;yz(k)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xCYujqVO(h)Go3-YqND*)C3;9TYUyIgU6Al$IqPJ?z;ZX2$xP>QS znzRHj7cs22vAu1+UC*t0a!YF^mqLQTs!twIW?qv zhz5EGsC3unOMD}xXfy6X6TMnm&_|pH>B@eBl6H_T@n=aY!Iyrz)nB57P1A}zcH#+o zVmwK2h^OfVaE)FNFVOfR_Ty!A(OtTmZp=~KCawR(0sI?1_zz-u1NVwr91X;Yo@Uc!-2af|94{~a0ugpJ|qGsa4s-_$v^^Af%Eht`XWU^rWaZZ?O{K~ ihF%#2sUT@iH+C9pqb0oM1|eSHs7jg0@HrX-xcxt3%CU$5 literal 0 HcmV?d00001 diff --git a/helm/xsltd/xaland-java-DOM/xaland_DOM.java b/helm/xsltd/xaland-java-DOM/xaland_DOM.java new file mode 100644 index 000000000..898f1f88e --- /dev/null +++ b/helm/xsltd/xaland-java-DOM/xaland_DOM.java @@ -0,0 +1,91 @@ +import org.apache.xalan.xslt.*; +import org.w3c.dom.Document; +import java.net.*; +import java.io.*; + +public class xaland_DOM { + public static void main(String argv[]) throws java.io.IOException, java.net.MalformedURLException, org.xml.sax.SAXException + { + int port = Integer.parseInt(argv[0]); + int port2 = Integer.parseInt(argv[1]); + String xsl1 = argv[2]; + String xsl2 = argv[3]; + String theory_xsl1 = argv[4]; + String theory_xsl2 = argv[5]; + + XSLTProcessor theory_processor = + XSLTProcessorFactory.getProcessor(new org.apache.xalan.xpath.xdom.XercesLiaison()); + StylesheetRoot theory_style1 = + theory_processor.processStylesheet(theory_xsl1); + theory_processor.reset(); + StylesheetRoot theory_style2 = + theory_processor.processStylesheet(theory_xsl2); + theory_processor.setStylesheet(theory_style2); + + XSLTProcessor processor = + XSLTProcessorFactory.getProcessor(new org.apache.xalan.xpath.xdom.XercesLiaison()); + StylesheetRoot style1 = processor.processStylesheet(xsl1); + processor.reset(); + StylesheetRoot style2 = processor.processStylesheet(xsl2); + processor.setStylesheet(style2); + + DatagramSocket socket = new DatagramSocket(port); + + System.out.println("Demon activated on input port " + port + + " and output port " + port2); + while(true) { + System.out.print("Ready..."); + + /* Warning: the packet must be a fresh one! */ + DatagramPacket packet = new DatagramPacket(new byte[1024],1024); + socket.receive(packet); + byte data[] = packet.getData(); + int datalen = packet.getLength(); + String received = new String(data,0,datalen); + + int first = received.indexOf(' '); + int last = received.lastIndexOf(' '); + String mode = received.substring(0,first); + String input = received.substring(first+1,last); + String output = received.substring(last+1); + + System.out.println("request received! Parameters are"); + System.out.println("Mode: " + mode + " "); + System.out.println("Input file: \"" + input + "\""); + System.out.println("Output file: \"" + output + "\"\n"); + + if ((new File(output)).exists()) { + System.out.println("Using cached version\n"); + } else { + FileOutputStream fout = new FileOutputStream(output); + if (mode.equals("cic")) { +Document content_doc = new org.apache.xerces.dom.DocumentImpl(); +XSLTResultTarget content = new XSLTResultTarget(content_doc); +/* + processor.setDocumentHandler(style2.getSAXSerializer(fout)); + XSLTResultTarget content = new XSLTResultTarget(processor); +*/ +System.out.print("Prima...\n"); + style1.process(new XSLTInputSource(input), content); +System.out.print("Durante...\n"); + style2.process(new XSLTInputSource(content_doc),new XSLTResultTarget(fout)); +System.out.print("Dopo...\n"); + } else if (mode.equals("theory")) { + theory_processor.setDocumentHandler( + theory_style2.getSAXSerializer(fout)); + XSLTResultTarget content = + new XSLTResultTarget(theory_processor); + theory_style1.process(new XSLTInputSource(input), content); + } + } + + InetAddress address = InetAddress.getLocalHost(); + DatagramSocket socket2 = new DatagramSocket(); + + byte buf[] = new byte[0]; + DatagramPacket packet2 = new DatagramPacket(buf,0,address,port2); + + socket2.send(packet2); + } + } +} diff --git a/helm/xsltd/xaland-java/xaland.java b/helm/xsltd/xaland-java/xaland.java index 1b9312c46..0ad6783f3 100644 --- a/helm/xsltd/xaland-java/xaland.java +++ b/helm/xsltd/xaland-java/xaland.java @@ -3,15 +3,6 @@ import java.net.*; import java.io.*; public class xaland { -/* - public static void Transform(StylesheetRoot style, String xmlSourceURL, String OutputURL) throws java.io.IOException, java.net.MalformedURLException, org.xml.sax.SAXException - { - XSLTInputSource xmlSource = new XSLTInputSource (xmlSourceURL); - XSLTResultTarget xmlResult = new XSLTResultTarget (OutputURL); - style.process(xmlSource, xmlResult); - } -*/ - public static void main(String argv[]) throws java.io.IOException, java.net.MalformedURLException, org.xml.sax.SAXException { int port = Integer.parseInt(argv[0]); diff --git a/helm/xsltd/xaland_DOM.class b/helm/xsltd/xaland_DOM.class new file mode 100644 index 0000000000000000000000000000000000000000..59c9683c9c09b9358475aa3f6416ac0488cc37a4 GIT binary patch literal 3555 zcma)9>vtPh5&vCT_O91^99y<*Z=9sctJrE{HE!d!n-@-;)DH3k%Q1FBNY>KYRw`-L z-IZ&%yeUv#rO?A8a0rxFN})gsmEtOtS9z5;gir7f@D)DxoE&C$Wm~T8bJ!1a=g!QX znLBr8_TJa;yz(k)a1j5HVasr2xH1YdJ}2YzGQJ?=s*JD5xF+MPGQK9`>oUG62lu(jzQ^K-@TM~XE;Z+GgmGCnOKbPlMFt^;AsY*X7G%PZ{WQQKCI$f_>hWk<8c+&@q~)! zv7q8RSXA)>KBnTk_<)M<;oT};VelHhtm0RAQpK-X{cjlj7N1b@JA6dN>v&4VAJ~mQ zGWI97`)7Py#b59q2Jct#H#{aFA_C13BbSO;1vg)CBYDeqi6-_41okKbHC^390b`K2hauJ#reQN> zotx257G`HnoAmKwQrOltwE618UB1q=6&v+-LQa}S_DFZ!vgcxp*-Xqa7GncevXC`% z?jY?rte`Mjf|luu;9aE&?J$c`DwM@({^*b`k|Jk}e? z8}7UpqN(Bdm|;7n9Zwr+$I4Zrw_cjvnM%Yb#%wD|XKnH6bZ@416TjJo@vUT8=}?Z6 zFkuz!q3kTqEaB8kqvkcMX_XD;F`6 zZhFCRO{%(FB+Xl1sXKYV%3D1>JydxO0|lE_n*K~Vy_hufZkqIwS}#nI*>uL#BUGu| z;^~|@QpnDj_JlE$Aw%KSY8azhbt}an&=|LpMrP8m(=11->W0ZtohrW3FPk-`^|Uf; z_}1ld(?~55PPYBiIYYL|%sGcT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