ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ninju Bohra <ninju_bo...@yahoo.com>
Subject Re: Question about <xmlcatalog> usage
Date Wed, 25 Jul 2007 12:19:18 GMT
Dang...I was so close to making a quick 'ANT' solution instead of writing a first-class JAVA
program to apply the modest modifications to the XML files.
Before giving up, and writing the JAVA program, what would be miminal change in the <!DOCTYPE
....> entry to allow the use of the <xmlcatalog> element?

Note...I also cross-posted a similar message to the xmltask-users mailing list (which has
must less activity that this ANT list) but described some <xmltask> error that I was
getting.
Specifically, even if I run the ANT script on a file system where the <!DOCTYPE ...>
entry should be resolvable (i.e. there is a  .dtd file at the location defined by the SYSTEM
entry) I get the error:

[xmltask] org.xml.sax.SAXParseException: Relative URIb "/some/directory/to/an/application.dtd";
can not be resolved without a base URI.
[xmltask] at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3376)
[xmltask] at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3370)
[xmltask] at org.apache.crimson.parser.Parser2.resolveURI(Parser2.java:2952)
[xmltask] at org.apache.crimson.parser.Parser2.maybeExternalID(Parser2.java:2924)
[xmltask] at org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1309)

Through 'trial-and-error' I was able to the get the <xmltask> call to work by adding
a 'file://' in front of the path information (allowing it to locate the file in the native
location, w/o any <xmlcatalog> entries).  I don't want to modify the <!DOCTYPE ...>
entry, but if I have to, I must (:sigh:)

What about using the deprecated <entity remote="..."/> sub-element of <xmltask>
to mask/redirect/remove the .dtd reference?

Thanx,

Ninju

----- Original Message ----
From: Brian Agnew <brian@oopsconsultancy.com>
To: Ant Users List <user@ant.apache.org>
Sent: Wednesday, July 25, 2007 3:27:57 AM
Subject: Re: Question about <xmlcatalog> usage


You really need the DTDs PUBLICID for xmlcatalog (see
http://ant.apache.org/manual/CoreTypes/xmlcatalog.html) but you don't
appear to have that in your DTD selection below. I'm not au fait with
<xmlcatalog> but I don't believe that it'll work with just a SYSTEM
identifier.

Brian

On Wed, July 25, 2007 03:53, Ninju Bohra wrote:
> Hello all,
>
> I've been given a directory of XML files that I need to process.  All the
> files have the following text at the top
>
> <?xml version=3D"1.0" encoding=3D"ISO-8859-1"?>
> <!DOCTYPE Simpson SYSTEM "/some/directory/to/an/application.dtd ">
> <Simpson command=3D"insert">
>     <Level class=3D"one" description=3D"Level One Information>
>     <Set value=3D"the value of the set"/>
>         .
>         .
>         .
>
> Now I am planning to proces the files using the cool <xmltask> (see
> http://www.oopsconsultancy.com/software/xmltask/ for more info) to process
> the file.
>
> However the problem is that I need to 'redirect' (or ignore) the DTD
> entry..since it will not be findable at the path specified in the file
> during processing
>
> I tried the following:
>
> <xmlcatalog id="dtds">
>     <dtd publicId="/some/directory/to/an/application.dtd"
> location=3D"${source.dir}/application.dtd"/>
> </xmlcatalog>
>
> and then referencing the 'id' from within the <xmltask> like this:
>
> <target name="removeSource">
>     <mkdir dir="${dest.dir}"/>
>     <xmltask todir="${dest.dir}">
>         <xmlcatalog refid="dtds"/>
>             .
>             .
>             .
>     </xmltask>
> </target>
>
> However it does not work.  I still errors stating that it can't find the
> application.dtd (in the original location)
>
> I have copy of the DTD file (in a different path) so how can I either
> redirect where the DTD is picked from (without modifying the file) or can
> I tell ANT to 'ignore' the DTD entry.
>
> Thanx,
>
> Ninju
>
>
>
> ____________________________________________________________________________________
> Got a little couch potato?
> Check out fun summer activities for kids.
> http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
Brian Agnew                  http://www.oopsconsultancy.com
OOPS Consultancy Ltd
Tel: +44 (0)7720 397526
Fax: +44 (0)20 8682 0012


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


       
____________________________________________________________________________________Ready
for the edge of your seat? 
Check out tonight's top picks on Yahoo! TV. 
http://tv.yahoo.com/

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


Mime
View raw message