You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by External Lists <ex...@ManagedObjects.com> on 2000/04/30 20:29:20 UTC

JAXP Question and Ant suggestion

Question about JAXP:
Where can I learn more about JAXP and how it will be used in Jakarta
projects?  The only ugly I have right now with the 3.1 release of Tomcat is
the clash between xml.jar and xerces.jar, and I'd like everything to use
Xerces, if possible.  I had even changed XmlMapper.java last week, but then
aborted because the scope of com.sun.xml was much broader in the code.

Suggestion for Ant:
There is an unintended difference on Windows in the <exec> task when a
directory *is* vs. *is not* specified and different from ".".  In one case,
the command goes through "cmd.exe /c" vs. being run directly.  This can
change what command syntax is legal, such as slashes, multiple commands,
setting env. vars, etc.).  In any case, the process's working directory is
not changed when the specified dir when Ant recurses into a new base
directory using the <ant> built-in task, so a recursive build will fail.  My
proposed change is to simply always change directories before running the
command:

<             if (!dir.equals(project.resolveFile(".")))
<                 command = "cmd /c cd " + dir + " && " + command;
---
>              command = "cmd /c cd " + dir + " && " + command;

Thanks for your help and consideration.

John W. Cocula
Managed Objects
john@ManagedObjects.com



Re: JAXP Question and Ant suggestion

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
External Lists wrote:

> Question about JAXP:
> Where can I learn more about JAXP and how it will be used in Jakarta
> projects?  The only ugly I have right now with the 3.1 release of Tomcat is
> the clash between xml.jar and xerces.jar, and I'd like everything to use
> Xerces, if possible.  I had even changed XmlMapper.java last week, but then
> aborted because the scope of com.sun.xml was much broader in the code.
>

Info about JAXP, as well as the reference implementation, is at
<http://java.sun.com/xml>.

For Tomcat, Ant has already been modified to be JAXP-compatible.  The same
change will be needed for Tomcat as well, making it possible to substitute your
own favoriate JAXP-compatible parser at runtime.

At the moment, Tomcat's code still works with the JAXP reference implementation
because the parser classname is the same.


> Suggestion for Ant:
> There is an unintended difference on Windows in the <exec> task when a
> directory *is* vs. *is not* specified and different from ".".  In one case,
> the command goes through "cmd.exe /c" vs. being run directly.  This can
> change what command syntax is legal, such as slashes, multiple commands,
> setting env. vars, etc.).  In any case, the process's working directory is
> not changed when the specified dir when Ant recurses into a new base
> directory using the <ant> built-in task, so a recursive build will fail.  My
> proposed change is to simply always change directories before running the
> command:
>
> <             if (!dir.equals(project.resolveFile(".")))
> <                 command = "cmd /c cd " + dir + " && " + command;
> ---
> >              command = "cmd /c cd " + dir + " && " + command;
>
> Thanks for your help and consideration.
>

You might want to join the ANT-DEV mailing list and point this issue out.

>
> John W. Cocula

Craig McClanahan