Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > pathelement with javac

Reply
Thread Tools

pathelement with javac

 
 
hawat.thufir@gmail.com
Guest
Posts: n/a
 
      06-01-2005
I think the compile target is causing the errors...?

from the terminal:

[thufir@localhost java]$ cat build.xml
<project name="tidy" default="package">

<import file="tidyBuild/properties.xml" />

<target name="clean">
<delete dir="${outputDir}" />
</target>

<target name="prepare" depends="clean">
<mkdir dir="${outputDir}" />
</target>

<echo message="classpath=${cp}" />

<target name="compile" depends="prepare">
<javac
srcdir ="${sourceDir}"
destdir ="${outputDir}">
<classpath>
<pathelement location="${tidy.path}" />
</classpath>
</javac>
</target>

<target name="package" depends="compile">
<jar jarfile="${outputDir}/${mainClass}.jar"
basedir="${outputDir}"
>

<manifest>
<attribute name="Main-Class"
value="${pkgPath}${mainClass}"/>
</manifest>
</jar>
</target>

</project>
[thufir@localhost java]$ cat tidyBuild/properties.xml
<project name="properties" basedir=".">
<property name="outputDir" value="bin/" />
<property name="sourceDir" value="src/atreides/tidyXhtml/" />
<property name="mainClass" value="Test16" />
<property name="pkgPath" value="atreides.tidyXhtml." />
<property name="user.name" value="thufir" />
<property name="cp" refid="tidy.path" />

<path id="tidy.path">
<pathelement location="lib/Tidy.jar" />
</path>
</project>
[thufir@localhost java]$ cat src/atreides/tidyXhtml/Test16.java
package atreides.tidyXhtml;

import java.io.IOException;
import java.net.URL;
import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.io.FileWriter;
import org.w3c.tidy.Tidy;


public class Test16 implements Runnable {

private String url;
private String outFileName;
private String errOutFileName;
private boolean xmlOut;

public Test16(String url, String outFileName,String
errOutFileName, boolean
xmlOut){
this.url = url;
this.outFileName = outFileName;
this.errOutFileName = errOutFileName;
this.xmlOut = xmlOut;
}//Test16

public void run() {
URL u;
BufferedInputStream in;
FileOutputStream out;
Tidy tidy = new Tidy();

tidy.setXmlOut(xmlOut);
try {
tidy.setErrout(new PrintWriter(new
FileWriter(errOutFileName), true));
u = new URL(url);
in = new BufferedInputStream(u.openStream());
out = new FileOutputStream(outFileName);
tidy.parse(in, out);
}//try
catch ( IOException e ) {
System.out.println( this.toString() + e.toString() );
}//catch
}//run

public static void main( String[] args ) {
Test16 t1 = new Test16(args[0], args[1], args[2], true);
Test16 t2 = new Test16(args[3], args[4], args[5], false);
Thread th1 = new Thread(t1);
Thread th2 = new Thread(t2);

th1.start();
th2.start();
}//main
}//Test16
[thufir@localhost java]$
[thufir@localhost java]$ ant
Buildfile: build.xml
Overriding previous definition of reference to tidy.path
[echo] classpath=/home/thufir/java/lib/Tidy.jar

clean:
[delete] Deleting directory /home/thufir/java/bin

prepare:
[mkdir] Created dir: /home/thufir/java/bin

compile:
[javac] Compiling 1 source file to /home/thufir/java/bin
[javac] /home/thufir/java/src/atreides/tidyXhtml/Test16.java:9:
package
org.w3c.tidy does not exist
[javac] import org.w3c.tidy.Tidy;
[javac] ^
[javac] /home/thufir/java/src/atreides/tidyXhtml/Test16.java:30:
cannot find
symbol
[javac] symbol : class Tidy
[javac] location: class atreides.tidyXhtml.Test16
[javac] Tidy tidy = new Tidy();
[javac] ^
[javac] /home/thufir/java/src/atreides/tidyXhtml/Test16.java:30:
cannot find
symbol
[javac] symbol : class Tidy
[javac] location: class atreides.tidyXhtml.Test16
[javac] Tidy tidy = new Tidy();
[javac] ^
[javac] 3 errors

BUILD FAILED
/home/thufir/java/build.xml:18: Compile failed; see the compiler error
output for
details.

Total time: 5 seconds
[thufir@localhost java]$



thanks,

Thufir

 
Reply With Quote
 
 
 
 
hawat.thufir@gmail.com
Guest
Posts: n/a
 
      06-02-2005
this seems to fix the problem. here's the new build.xml:

<project name="tidy" default="package">

<import file="tidyBuild/properties.xml" />

<target name="clean">
<delete dir="${outputDir}" />
</target>

<target name="prepare" depends="clean">
<mkdir dir="${outputDir}" />
</target>

<echo message="classpath=${cp}" />

<target name="compile" depends="prepare">
<javac
srcdir ="${sourceDir}"
destdir ="${outputDir}">
<classpath>
<path refid="tidy.path" />
</classpath>
</javac>
</target>

<target name="package" depends="compile">
<jar jarfile="${outputDir}/${mainClass}.jar"
basedir="${outputDir}" >
<manifest>
<attribute name="Main-Class"
value="${pkgPath}${mainClass}"/>
</manifest>
</jar>
</target>

</project>


is ant offtopic here, or something?


-Thufir

 
Reply With Quote
 
 
 
 
HALLES
Guest
Posts: n/a
 
      06-03-2005
Hello !
It llok like a java class to make a XML files, using read write append
?

Do i mistake?

Can java class be used in client side ?
To automatize data input and file writing ?
I can't invest on a server and its softs.

I have a structured work to save on local drive, linear files like TXT
are of no use.
Actually all the work is or in my mind or on thousands of papers with
cross references.
It is no dictionary like, linear job to do.

Dynamic files can help, because while already structured the info put
on the files can be used to build a more structured file or more
structured files.

It become complex, to explain, it is only a work of linguistic, and it
can be done by a computer.

Any info back, welcome.

Regards.
HALLES.

 
Reply With Quote
 
hawat.thufir@gmail.com
Guest
Posts: n/a
 
      06-03-2005
HALLES wrote:
> Hello !
> It llok like a java class to make a XML files, using read write append
> ?
>
> Do i mistake?


I don't believe so

> Can java class be used in client side ?


sure, send this class a URL and it will tidy-ize it. that is, take old
fashioned html and convert it to XHTML. my pet project is to work on
some html files which exist on my hard drive, along the lines of your
plans.

> To automatize data input and file writing ?
> I can't invest on a server and its softs.
>
> I have a structured work to save on local drive, linear files like TXT
> are of no use.
> Actually all the work is or in my mind or on thousands of papers with
> cross references.
> It is no dictionary like, linear job to do.
>
> Dynamic files can help, because while already structured the info put
> on the files can be used to build a more structured file or more
> structured files.
>
> It become complex, to explain, it is only a work of linguistic, and it
> can be done by a computer.
>
> Any info back, welcome.
>
> Regards.
> HALLES.



check out the tidy and jtidy projects on <http://www.sourceforge.net/>.


-Thufir

 
Reply With Quote
 
HALLES
Guest
Posts: n/a
 
      06-04-2005
Hello.

You speak of URL, i can't see how to declare an drive as an URL.

I have stopped programing 10 years ago, i used TP 7, nice but 16 bit
limited.

I will try jtidy.

Regards.

HALLES ;o)

 
Reply With Quote
 
hawat.thufir@gmail.com
Guest
Posts: n/a
 
      06-04-2005
HALLES wrote:
> Hello.
>
> You speak of URL, i can't see how to declare an drive as an URL.


pardon, it doesn't have to be a URL. when you unzip the files from
sourceforge there will be a file names Tidy.jar, this is what you're
after. when you feed a html file through Tidy.jar it will convert it
to xhtml, like magic. the java code I have, Test16, that happens to
take a url as input, however, Tidy.jar will take any html file as input
as far as I know. To my knowledge it should be trivial to feed it a
file, foo.html, versus a URL.

> I have stopped programing 10 years ago, i used TP 7, nice but 16 bit
> limited.


java is object oriented, just as a heads up.

> I will try jtidy.
>
> Regards.
>
> HALLES ;o)


I've sent you an e-mail, since this is getting off topic for xml.

-Thufir

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ant javac : How to print classpath? Ronald Fischer Java 1 09-19-2003 01:13 AM
Re: Problem with ant's javac task z3 Java 0 07-23-2003 06:39 PM
javac doesn't show decprecated API calls to me Richard Ivarson Java 1 07-14-2003 03:33 PM
Re: JDK 1.4.2 javac compiler bug with final local variables? Jon Skeet Java 5 07-04-2003 03:17 PM
Sun JDK 1.4.2 javac compiler bug xarax Java 1 07-02-2003 05:08 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57