From cd3f2cc347f7d74ad8bf8146f03dd21c6cf7b9a8 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Fri, 17 Nov 2000 10:31:18 +0000 Subject: [PATCH] Initial revision --- helm/xsltd/Makefile | 29 +++ helm/xsltd/cadet | 11 + helm/xsltd/isterix | 10 + helm/xsltd/xaland-cpp/xaland.cpp | 207 ++++++++++++++++++ helm/xsltd/xaland-java/rompi.class | Bin 0 -> 732 bytes helm/xsltd/xaland-java/rompi.java | 12 + helm/xsltd/xaland-java/sped.class | Bin 0 -> 1142 bytes helm/xsltd/xaland-java/sped.java | 28 +++ helm/xsltd/xaland-java/xaland.class | Bin 0 -> 3509 bytes helm/xsltd/xaland-java/xaland.java | 91 ++++++++ .../xaland.java.prima_del_loro_baco | 85 +++++++ ...d.java.prima_del_loro_baco_ma_dopo_i_reset | 87 ++++++++ helm/xsltd/xaland-java2/xaland2.class | Bin 0 -> 3773 bytes helm/xsltd/xaland-java2/xaland2.java | 134 ++++++++++++ 14 files changed, 694 insertions(+) create mode 100644 helm/xsltd/Makefile create mode 100755 helm/xsltd/cadet create mode 100755 helm/xsltd/isterix create mode 100644 helm/xsltd/xaland-cpp/xaland.cpp create mode 100644 helm/xsltd/xaland-java/rompi.class create mode 100644 helm/xsltd/xaland-java/rompi.java create mode 100644 helm/xsltd/xaland-java/sped.class create mode 100644 helm/xsltd/xaland-java/sped.java create mode 100644 helm/xsltd/xaland-java/xaland.class create mode 100644 helm/xsltd/xaland-java/xaland.java create mode 100644 helm/xsltd/xaland-java/xaland.java.prima_del_loro_baco create mode 100644 helm/xsltd/xaland-java/xaland.java.prima_del_loro_baco_ma_dopo_i_reset create mode 100644 helm/xsltd/xaland-java2/xaland2.class create mode 100644 helm/xsltd/xaland-java2/xaland2.java diff --git a/helm/xsltd/Makefile b/helm/xsltd/Makefile new file mode 100644 index 000000000..83c51d9d5 --- /dev/null +++ b/helm/xsltd/Makefile @@ -0,0 +1,29 @@ +start-xaland: + java -ss1024K -oss8192K \ + xaland 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 \ + $(HELM_STYLES_DIR)/rootcontent.xsl \ + $(HELM_STYLES_DIR)/annotatedpres.xsl \ + $(HELM_STYLES_DIR)/theory_content.xsl \ + $(HELM_STYLES_DIR)/theory_pres.xsl + +start-xaland-old: + java xaland 12345 12346 \ + $(HELM_STYLES_DIR)/style_prima_del_linguaggio_naturale/rootcontent.xsl \ + $(HELM_STYLES_DIR)/style_prima_del_linguaggio_naturale/annotatedpres.xsl \ + $(HELM_STYLES_DIR)/style_prima_del_linguaggio_naturale/theory_content.xsl \ + $(HELM_STYLES_DIR)/style_prima_del_linguaggio_naturale/theory_pres.xsl + +start-xaland3: + java xaland 12347 12348 \ + $(HELM_STYLES_DIR)/rootcontent.xsl \ + $(HELM_STYLES_DIR)/annotatedpres.xsl \ + $(HELM_STYLES_DIR)/theory_content.xsl \ + $(HELM_STYLES_DIR)/theory_pres.xsl diff --git a/helm/xsltd/cadet b/helm/xsltd/cadet new file mode 100755 index 000000000..6206c54cd --- /dev/null +++ b/helm/xsltd/cadet @@ -0,0 +1,11 @@ +#! /bin/sh + +export PATH=~/HELM/installation/jdk118/bin:$PATH + +#export CLASSPATH=/home/cadet/sacerdot/xalan-j_1_1/xalan.jar:/home/cadet/sacerdot/xalan-j_1_1/xerces.jar:. +export CLASSPATH=~/HELM/installation/xalan-j_1_2/xalan.jar:~/HELM/installation/xalan-j_1_2/xerces.jar:. +#export CLASSPATH=~/HELM/installation/xalan-j_1_2_1/xalan.jar:~/HELM/installation/xalan-j_1_2_1/xerces.jar:. +#export CLASSPATH=/home/cadet/sacerdot/xalan-j_2_0_D01/bin/xalan.jar:/home/cadet/sacerdot/xalan-j_2_0_D01/bin/xerces.jar:. + +export HELM_STYLES_DIR=../V6.2/examples/style +#export HELM_STYLES_DIR=../V7/examples/style diff --git a/helm/xsltd/isterix b/helm/xsltd/isterix new file mode 100755 index 000000000..e11d92c8b --- /dev/null +++ b/helm/xsltd/isterix @@ -0,0 +1,10 @@ +#! /bin/sh + +export PATH=$PATH:/opt/java/jdk118/bin/ + +export CLASSPATH=. +export CLASSPATH=$CLASSPATH:/home/lpadovan/helm/java/xalan_1_1/xalan.jar +export CLASSPATH=$CLASSPATH:/home/lpadovan/helm/java/xalan_1_1/xerces.jar +export CLASSPATH=$CLASSPATH:/home/lpadovan/helm/java/saxon-5.3.2/saxon.jar + +export HELM_STYLES_DIR=../V6.2/examples/style diff --git a/helm/xsltd/xaland-cpp/xaland.cpp b/helm/xsltd/xaland-cpp/xaland.cpp new file mode 100644 index 000000000..e22140267 --- /dev/null +++ b/helm/xsltd/xaland-cpp/xaland.cpp @@ -0,0 +1,207 @@ +// Base header file. Must be first. +#include + +#include +#include + +#include + +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +int main(int argc, const char* []) +{ +#if !defined(XALAN_NO_NAMESPACES) + using std::cerr; + using std::endl; + using std::ofstream; +#endif + + if (argc != 1) { + cerr << "Usage: SimpleTransform" + << endl + << endl; + } else { + try { + // Call the static initializer for Xerces... + XMLPlatformUtils::Initialize(); + + { + // Initialize the Xalan XSLT subsystem... + XSLTInit theInit; + + // Create the support objects that are necessary for + // running the processor... + XercesDOMSupport theDOMSupport; + XercesParserLiaison theParserLiaison(theDOMSupport); + XPathSupportDefault theXPathSupport(theDOMSupport); + XSLTProcessorEnvSupportDefault theXSLTProcessorEnvSupport; + XObjectFactoryDefault theXObjectFactory; + XPathFactoryDefault theXPathFactory; + + // Create a processor... + XSLTEngineImpl theProcessor( + theParserLiaison, + theXPathSupport, + theXSLTProcessorEnvSupport, + theDOMSupport, + theXObjectFactory, + theXPathFactory); + + // Connect the processor to the support object... + theXSLTProcessorEnvSupport.setProcessor(&theProcessor); + + // Create a stylesheet construction context, and a stylesheet + // execution context... + StylesheetConstructionContextDefault theConstructionContext( + theProcessor, + theXSLTProcessorEnvSupport, + theXPathFactory); + + StylesheetExecutionContextDefault theExecutionContext( + theProcessor, + theXSLTProcessorEnvSupport, + theXPathSupport, + theXObjectFactory); + + // Our input files...The assumption is that the executable will be + // run from same directory as the input files. + const XalanDOMString theXMLFileName("foo.xml"); + const XalanDOMString theXSLFileName("foo.xsl"); + + // Our input sources... + XSLTInputSource theInputSource(c_wstr(theXMLFileName)); + XSLTInputSource theStylesheetSource(c_wstr(theXSLFileName)); + + // Our output target... + const XalanDOMString theOutputFileName("foo.out"); + XSLTResultTarget theResultTarget(theOutputFileName); + + theProcessor.process( + theInputSource, + theStylesheetSource, + theResultTarget, + theConstructionContext, + theExecutionContext); + + } + + // Call the static terminator for Xerces... + XMLPlatformUtils::Terminate(); + } + catch(...) { + cerr << "Exception caught!!!" + << endl + << endl; + } + } + + return 0; +} + +/**************************************************/ +/* + +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]); + 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")) { + processor.setDocumentHandler(style2.getSAXSerializer(fout)); + XSLTResultTarget content = new XSLTResultTarget(processor); + style1.process(new XSLTInputSource(input), content); + } 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/rompi.class b/helm/xsltd/xaland-java/rompi.class new file mode 100644 index 0000000000000000000000000000000000000000..4abfe3865ad89dd63981985bc0c6ff02a72ffbf9 GIT binary patch literal 732 zcmZuvTTc@~6#k~&?v!OCH`{vQvM9&`mE~12K6r~Htq`gvgs15;HiNr6&0dK9EPbGf z7=M62%6MiqrAFrA+~$1WIcMhl{Ppbzs(6UqI#xLDbF6W!b3EYK;P5#%Id&Xan03H0 z=fKAN6lz#-2zArM8ZH*mG@@n19T(eJbW`6-mc zTGGFTo?YO^cKZS|S5!?}JQ7xBcDnwqV KV)w|aAovY)#-^kI literal 0 HcmV?d00001 diff --git a/helm/xsltd/xaland-java/rompi.java b/helm/xsltd/xaland-java/rompi.java new file mode 100644 index 000000000..6a633dbc9 --- /dev/null +++ b/helm/xsltd/xaland-java/rompi.java @@ -0,0 +1,12 @@ +import java.net.*; + +public class rompi { + public static void main(String argv[]) throws java.io.IOException, java.net.MalformedURLException + { + /* Wait forever ;-) */ + DatagramSocket socket2 = new DatagramSocket(12346); + DatagramPacket packet2 = new DatagramPacket(new byte[1],1); + System.out.println("Ho preso il socket e non lo lascio piu', caro pu, caro pu"); + socket2.receive(packet2); + } +} diff --git a/helm/xsltd/xaland-java/sped.class b/helm/xsltd/xaland-java/sped.class new file mode 100644 index 0000000000000000000000000000000000000000..cc6f53dac35bcca947942989dc7259047fd6f055 GIT binary patch literal 1142 zcmZuw+fvg|6kUg=O&T&nfdWB5@PeUSibYWZqLhn73pj$#Fg%6!vcu z4V98~6><{>RD^L`MFfKahJ-n+Lc$#t3PyxBDw6LCxF@3bh3|oe$4Cg65Req`NI*)% zJf=06nAEUISF04Fx(^JJVF{rambIS_)G?!_(e}Y1&-x2D_MU7_JU{VzV!D>k z^9r38zbT!L9z6F8hO4%37bnS_+uOoUTgrwH#&oS?sfTV1S<*d+Y}Wr~zK`b_Br-Dda{@?Ha) z8PTOWdgkP~e5RO+E`{Q=v{9P=8Ch+x{sJ!W{l)+Q literal 0 HcmV?d00001 diff --git a/helm/xsltd/xaland-java/sped.java b/helm/xsltd/xaland-java/sped.java new file mode 100644 index 000000000..9d96610d4 --- /dev/null +++ b/helm/xsltd/xaland-java/sped.java @@ -0,0 +1,28 @@ +import java.net.*; + +public class sped { + public static void main(String argv[]) throws java.io.IOException, java.net.MalformedURLException + { + String input = argv[0]; + String out1 = argv[1]; + String out2 = argv[2]; + + String sent = input + " " + out1 + " " + out2; + + InetAddress address = InetAddress.getLocalHost(); + DatagramSocket socket = new DatagramSocket(); + + int strlen = sent.length(); + byte buf[] = new byte[strlen]; + sent.getBytes(0,strlen,buf,0); + DatagramPacket packet = new DatagramPacket(buf,strlen,address,12345); + + socket.send(packet); + + + /* Wait for answer (or forever ;-) */ + DatagramSocket socket2 = new DatagramSocket(12346); + DatagramPacket packet2 = new DatagramPacket(new byte[1],1); + socket2.receive(packet2); + } +} diff --git a/helm/xsltd/xaland-java/xaland.class b/helm/xsltd/xaland-java/xaland.class new file mode 100644 index 0000000000000000000000000000000000000000..6871fda4b77e5da54ed99846b0a35652ccaf2961 GIT binary patch literal 3509 zcma)9Yfu~475=Uyw9B%?Lm*%cr1G&A<;fE-Dy?5+qT zO`mC-PTx&m?jwEIY1*_++DIn2Y12pA=}dogCjUCq>Ay~A`l~Z-e{?3(b9My?kY@rj z=bn4s_uO;NUj6aSS6)RBefWcnw2W&q9+8oe@o^cSl<`>^pOf*7j4#UgvW!<{{8qxZ zBz#-KcO-mQ!uKS6U&0Lu&q?@!gy$vvP{NNSyddGH5?++>l7yd0__>6aB@`vRuAmvC z3fdWT_}B#n^>{!*1A{1oE(S3lBowq^OhF4SGB(a46AT_?+9c~vF=Lv+B?TI06ub@Z zRM3f87MWx4P%T<~BdlJ`-Wh0(3a*OdP*G}gahXmR;$T`!E zj}kbYO4+945R3F?Jou16sJrL#8D2)&R+N@%#yYCe&lDCGOq=YnG8t^`9<8o@tlPJl zw&LU7NhnCu$PV=+EPFA&lFh^&VuSbymQ2%~v@Dm-Tr~ztLTA}1 zXMNakjYZqYP8i8YObVUY)7{>gw>!ui?vj^=*|EfgVLPUsNE>O#%9S&;U7Ew0ok~nk z*jAG6)8ZTGsb;oH+#JH#Ta?|ExS`z?wl{e@dmQ9wjtY0mD%eSLsLIJV&N68_g^W9G z*o);n#eAc;s}1%W?!J7+t2>Di59?ygk8)?#mn-yg^)rM|q;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kGe;tkx1zhD6Wz}@&4j^Te8 z6g9XUi_K%Z{U9M zSB!|iVO0E`)_>vw@o!uZ|3xAoVIrX7!9WyKfjyWG^k61%6umpzO3;snJT)PAY!|J9 W)|%cD_HXrO*e4SFJTU|K{r>@yPnx#? literal 0 HcmV?d00001 diff --git a/helm/xsltd/xaland-java/xaland.java b/helm/xsltd/xaland-java/xaland.java new file mode 100644 index 000000000..1b9312c46 --- /dev/null +++ b/helm/xsltd/xaland-java/xaland.java @@ -0,0 +1,91 @@ +import org.apache.xalan.xslt.*; +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]); + 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")) { + processor.setDocumentHandler(style2.getSAXSerializer(fout)); + XSLTResultTarget content = new XSLTResultTarget(processor); + style1.process(new XSLTInputSource(input), content); + } 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.prima_del_loro_baco b/helm/xsltd/xaland-java/xaland.java.prima_del_loro_baco new file mode 100644 index 000000000..b46ffa6aa --- /dev/null +++ b/helm/xsltd/xaland-java/xaland.java.prima_del_loro_baco @@ -0,0 +1,85 @@ +import org.apache.xalan.xslt.*; +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]); + 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(); + StylesheetRoot theory_style1 = + theory_processor.processStylesheet(theory_xsl1); + StylesheetRoot theory_style2 = + theory_processor.processStylesheet(theory_xsl2); + theory_processor.setStylesheet(theory_style2); + + XSLTProcessor processor = XSLTProcessorFactory.getProcessor(); + StylesheetRoot style1 = processor.processStylesheet(xsl1); + 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")) { + processor.setDocumentHandler(style2.getSAXSerializer(fout)); + XSLTResultTarget content = new XSLTResultTarget(processor); + style1.process(new XSLTInputSource(input), content); + } 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.prima_del_loro_baco_ma_dopo_i_reset b/helm/xsltd/xaland-java/xaland.java.prima_del_loro_baco_ma_dopo_i_reset new file mode 100644 index 000000000..1467cdd2e --- /dev/null +++ b/helm/xsltd/xaland-java/xaland.java.prima_del_loro_baco_ma_dopo_i_reset @@ -0,0 +1,87 @@ +import org.apache.xalan.xslt.*; +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]); + 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(); + 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(); + 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")) { + processor.setDocumentHandler(style2.getSAXSerializer(fout)); + XSLTResultTarget content = new XSLTResultTarget(processor); + style1.process(new XSLTInputSource(input), content); + } 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-java2/xaland2.class b/helm/xsltd/xaland-java2/xaland2.class new file mode 100644 index 0000000000000000000000000000000000000000..95b42c712d3475766cddddbc121344701c3c66a8 GIT binary patch literal 3773 zcmb7HdvqLC8UNkcO=hw?Cyz}x$>h}~wvePv2GSB?(pLKljpWrPElpb_liizS+kJIr z5;m=-p#LGV>kL_ysoq@YL@Me&U#GEKm40NIC%W-%xjBi@U;qssI21q?Mgj;4P$$490qQXtKrIdn?1*68A;8ffHexJ*RvZ)D z<3jg@5V);4 z#U-3q@fEyJ#gllyimwXB*N|256wavlIzFu88@N}+3j%x(52|<(XI1d_=|Xai0M9tN0`47+8d%Dq^N$k@Sp{ znQt~-{Q)kiHeWlyH9B)3SSIWLh-CUl#)d($b0r+I|#dtSVH$sQej*rryEL`4(EBD37G$th~< zQZtj`sTf10X|HZP>Z)iwN^VA}z#YEabfm*i&zK3}2G7QAhY)#+J0i{0IE1 zLDu7`7|#w((!uU*qWF22t}EUaw<|++fz>y(oTDOYQT%Bxu1vf>8ckE&qHwLyys}?K z@@j~pu_EP>yk=f4J7+sQ$x!RcUfnS3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