You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Mi...@objectweb.org on 2004/01/14 17:03:51 UTC

XMLCATALOG question

I'm using ANT 1.6 and not sure if I have found a bug in ANT <style>
processing, or if I have an error in my use of the feature.  I've searched
the archive, but do not see anything that helps.

JDK: Sun J2SE 1.4.2_03
ANT: 1.6
CLASSPATH: not defined prior to invoking ANT
OS: Windows XP Pro

I have a collection of XML documents that contain <!DOCTYPE xxx SYSTEM
"../dtd/my.dtd">

To place XML files into subcatalogs, the SYSTEM path information has to be
modified:
<!DOCTYPE xxx SYSTEM "../dtd/my.dtd"> for first level catalog
<!DOCTYPE xxx SYSTEM "../../dtd/my.dtd"> for second level catalog, ...

I thought I could clean this up by using xmlcatalog to resolve the dtd to a
fixed location as:
<!DOCTYPE xxx PUBLIC "-//my//xxx//EN" "my.dtd">
<!-- note relative path is same in all documents regardless of directory
-->

Then in the build.xml:
<style ...>
 <xmlcatalog>
 <dtd publicId="-//my//xxx/EN" location="${dtd.dir}/my.dtd" />
</xmlcatalog>
</style>

When ANT runs this task, I get errors indicating that my.dtd is not found.
The path that is displayed for the file not found error is always qualified
with the directory of the xml file.  The <style> task is resolving the
system path information from the DOCTYPE tag and not using the xmlcatalog.

NOTE -- the exact same xmlcatalog is working within an xmlvalidate task in
the same build.xml file.

Michael Giroux



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: XMLCATALOG question

Posted by Antoine Lévy-Lambert <an...@antbuild.com>.
Michael.Giroux@objectweb.org wrote:

>I'm using ANT 1.6 and not sure if I have found a bug in ANT <style>
>processing, or if I have an error in my use of the feature.  I've searched
>the archive, but do not see anything that helps.
>
>JDK: Sun J2SE 1.4.2_03
>ANT: 1.6
>CLASSPATH: not defined prior to invoking ANT
>OS: Windows XP Pro
>
>I have a collection of XML documents that contain <!DOCTYPE xxx SYSTEM
>"../dtd/my.dtd">
>
>To place XML files into subcatalogs, the SYSTEM path information has to be
>modified:
><!DOCTYPE xxx SYSTEM "../dtd/my.dtd"> for first level catalog
><!DOCTYPE xxx SYSTEM "../../dtd/my.dtd"> for second level catalog, ...
>
>I thought I could clean this up by using xmlcatalog to resolve the dtd to a
>fixed location as:
><!DOCTYPE xxx PUBLIC "-//my//xxx//EN" "my.dtd">
><!-- note relative path is same in all documents regardless of directory
>-->
>
>Then in the build.xml:
><style ...>
> <xmlcatalog>
> <dtd publicId="-//my//xxx/EN" location="${dtd.dir}/my.dtd" />
></xmlcatalog>
></style>
>
>When ANT runs this task, I get errors indicating that my.dtd is not found.
>The path that is displayed for the file not found error is always qualified
>with the directory of the xml file.  The <style> task is resolving the
>system path information from the DOCTYPE tag and not using the xmlcatalog.
>
>NOTE -- the exact same xmlcatalog is working within an xmlvalidate task in
>the same build.xml file.
>
>Michael Giroux
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>  
>
Hi Michael,
not sure if this helps a lot, but just before ant 1.6.0 was released I 
fixed a similar bug :
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23913
maybe if you have a look at the bug report it will give you some idea.
It is quite possible that there is still something wrong in this area.

As a workaround :
make sure that dtd.dir is an absolute path, maybe define dtd.dir like this :
<property name="dtd.dir" 
location="some.relative.location.to.the.project.dir"/>
then ant will automatically store under ${dtd.dir} the absolute path and 
it might work better.

Cheers,

Antoine

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org