ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brett Knights" <br...@knightsofthenet.com>
Subject RE: Re[2]: Style task
Date Thu, 21 Jun 2001 03:17:56 GMT
To make this work I did two things:

1. I have the jaxp 1.1 files (jaxp.jar, crimson.jar) in my classpath. I removed the jaxp.jar
and parser.jar files from the ant/lib
directory. (May only be necessary if using Saxon)

2. I added the <include> element to the style task:
  <target name="transform" depends="init">
    <mkdir dir="${dest}"/>
    <style
    	basedir="${src}"
    	destdir="${dest}"
    	extension=".xml"
    	style="styles/default.xsl">
    	<include name="**/*.xml"/>
    </style>
  </target>

Interestingly without the <include/> element the error given is that the task can't
find the stylesheet. This may be a bug in the
error reporting mechanism:

Error
  java.io.FileNotFoundException: C:\WINDOWS\TEMP\src\default.xsl (The system can
not find the file specified): C:\WINDOWS\TEMP\src\default.xsl (The system cannot
 find the file specified)

Have fun!


BTW if you have jdk 1.3 and crimson.jar in your classpath you may need to make crimson.jar
load before other xml related jars  to
avoid the sealing violation error.
> -----Original Message-----
> From: Frank Carver [mailto:frank@efsol.com]
> Sent: Wednesday, June 20, 2001 3:28 PM
> To: Brett Knights
> Subject: Re[2]: Style task
>
>
>
> Tuesday, June 19, 2001, 10:12:52 PM, you wrote:
>
> BK> I use it all the time. My xsl engine is Saxon 6.3
> BK> I notice you don't have a namespace declaration for the
> xsl namespace.
> BK> try adding this attribute to your stylesheet element
> BK> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
> Thanks for your reply.  I've tried that, but I still can't make it
> work.  I'm trying the same thing on a different machine now, and I
> get a different, and also unhelpful, error.  This is driving me nuts!
>
> transform:
>     [style] Transforming into C:\Projects\www\_temp\dest
>     [style] Loading stylesheet
> C:\Projects\www\_temp\src\styles\default.xsl
>     [style] Transforming into C:\Projects\www\_temp\dest
> SystemId Unknown; Line 0; Column 0;     [style] Failed to
> process C:\Projects\www\_temp\src\test.xml
>
> BUILD FAILED
>
> C:\Projects\www\_temp\build.xml:11:
> javax.xml.transform.TransformerException: SA
> X Exception
> --- Nested Exception ---
> javax.xml.transform.TransformerException: SAX Exception
>         at
> org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1528)
>         at
> org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1493)
>         at
> org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java:525)
>         at
> org.apache.tools.ant.taskdefs.optional.XalanLiaison.transform(
> XalanLiaison.java)
>         at
> org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.
> java:285)
>         at
> org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.
> java:180)
>         at org.apache.tools.ant.Target.execute(Target.java:153)
>         at org.apache.tools.ant.Project.runTarget(Project.java:898)
>         at
> org.apache.tools.ant.Project.executeTarget(Project.java:536)
>         at
> org.apache.tools.ant.Project.executeTargets(Project.java:510)
>         at org.apache.tools.ant.Main.runBuild(Main.java:421)
>         at org.apache.tools.ant.Main.main(Main.java:149)
>
> If you have the time, I would really appreciate you taking a look
> at the attachment, to see if you can spot anything stupid.
> I've zipped
> up a tiny project which should just xsl a single file.  If you can
> make it work I'll know it's some sort of configuration issue.
>
> Many thanks in advance,
>
> --
> Frank Carver     frank@efsol.com    http://www.efsol.com/


Mime
View raw message