PDA

Visualizza la versione completa : JAVA e XML


gleone
04-09-2002, 15:53
sto cercando di fare una trasformazione di un documento XML in uno html tramite un parser JAVA (ho scaricato xalan-j_2_4_0 e xml4j-4_0_1)

- ho impostato la variabile CLASSPATH che punta al file xalan.jar (C:\xalan-j_2_4_0\bin\xalan.jar)
- ho creato i miei file file.xml, file.xsl e la classe java xslt.java
Il cui codice :
----------------------------------------------
import org.apache.xalan.*;

public class xslt
{
public static void main(String[] args)
{
try {
XSLTProcessor processor = XSLTProcessorfactory.getProcessor();
processor.process(new XSLTInputSource(args[0]),new XSLTInputSource(args[1]), new XSLTInputSource(args[2]));
}catch (Exception e){
System.err.println(e.getMessage);
}
}
}
------------------------------------------------

- ho scritto nel prompt dos: javac xslt.java
e mi ha dato 6 errori


chi mi sa rispondere?

grazie 1000
:bh: :bh:

danka
04-09-2002, 17:30
ma che tipo di errori ti da?

gleone
05-09-2002, 08:51
gli errori che mi da, dopo aver fatto le operazioni che ho descritto sopra, sono questi:

---------------------------------------------
C:\esercizi>javac xslt.java
xslt.java:8: cannot resolve symbol
symbol : class XSLTProcessor
location: class xslt
XSLTProcessor processor = XSLTProcessorfactory.getProcessor();
^
xslt.java:8: cannot resolve symbol
symbol : variable XSLTProcessorfactory
location: class xslt
XSLTProcessor processor = XSLTProcessorfactory.getProcessor();
^
xslt.java:9: cannot resolve symbol
symbol : class XSLTInputSource
location: class xslt
processor.process(new XSLTInputSource(args[0]),new XSLTInputSource(arg
s[1]), new XSLTInputSource(args[2]));
^
xslt.java:9: cannot resolve symbol
symbol : class XSLTInputSource
location: class xslt
processor.process(new XSLTInputSource(args[0]),new XSLTInputSource(arg
s[1]), new XSLTInputSource(args[2]));
^
xslt.java:9: cannot resolve symbol
symbol : class XSLTInputSource
location: class xslt
processor.process(new XSLTInputSource(args[0]),new XSLTInputSource(arg
s[1]), new XSLTInputSource(args[2]));

^
xslt.java:11: cannot resolve symbol
symbol : variable getMessage
location: class java.lang.Exception
System.err.println(e.getMessage);
^
6 errors
---------------------------------------------------------

Loading