Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8836585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:31:48+00:00 2026-06-14T09:31:48+00:00

I am running some XSL transforms via Ant’s XSLT task. I am using Saxon

  • 0

I am running some XSL transforms via Ant’s XSLT task. I am using Saxon 9HE as the processing engine. I have a situation where the input XML files all use the same DTD but declare it to be in different places. Some declare it to be in the current directory, some in a folder and others reference a URL. Here is the Ant script:

<?xml version="1.0" encoding="UTF-8"?>

<project name="PubXML2EHeader" default="transform">
    <property name="data.dir.input" value="./InputXML"/>
    <property name="data.dir.output" value="./converted-xml"/>
    <property name="xslt.processor.location" value="D:\\saxon9he.jar"/>
    <property name="xslt.processor.factory" value="net.sf.saxon.TransformerFactoryImpl"/>

    <path id="saxon9.classpath" location="${xslt.processor.location}"/>

    <target name="clean">
        <delete dir="${data.dir.output}" includes="*.xml" failonerror="no"/>
    </target>

    <target name="transform" depends="clean">
        <xslt destdir="${data.dir.output}"
              extension=".xml"
              failOnTransformationError="false"
              processor="trax"
              style="Transform.xsl"
              useImplicitFileset="false"
              classpathref="saxon9.classpath"
        >
            <outputproperty name="method" value="xml"/>
            <outputproperty name="indent" value="yes"/>
            <fileset dir="${data.dir.input}" includes="**/*.xml" excludes="Transform.xml"/>
            <factory name="${xslt.processor.factory}"/>
        </xslt>
    </target>

</project>

When I run this Ant script I get errors like this:

[xslt] : Fatal Error! I/O error reported by XML parser processing
file:/D:/annurev.biophys.093008.131228.xml:
http://www.atypon.com/DTD/nlm-dtd/archivearticle.dtd Cause:
java.io.FileNotFoundException:
http://www.atypon.com/DTD/nlm-dtd/archivearticle.dtd

I think these are caused by the fact that Saxon cannot get to the DTD (which is a actually a firewall issue in this case). I don’t think I care about validating the input, which is what I think is happening here, and I would like to skip it. Is there an attribute I can add to the XSLT Ant task to stop Saxon from trying to read in the DTD?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:31:49+00:00Added an answer on June 14, 2026 at 9:31 am

    You are confusing “reading the DTD” with validating. An XSLT processor will always ask the parser to read the external DTD of a document whether it is validating or not. This is because a DTD is used for more than validation; it is also used for expansion of entity references.

    The usual way to deal with this problem is to redirect the DTD reference to a copy that is somewhere it can be accessed, generally by use of catalogs. This involves setting an EntityResolver on the underlying XML parser.

    There’s lots of information on the web about how to set up a catalog resolver with Saxon, usually from the command line: see for example here: http://www.sagehill.net/docbookxsl/UseCatalog.html

    The advice is generally to set the -x, -y, and -r options, but in fact only -x is relevant if you only need to redirect DTD references in source documents (-y affects stylesheets, -r affects the document() function). In Ant, the equivalent to setting the -x option is to use the attribute child of the factory element to set the configuration property<attribute name="http://saxon.sf.net/feature/sourceParserClass" value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>.

    That still leaves the part I find tricky, which is actually creating your catalog file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When running some tests I came across the following issue. When using: private String
I have some C++ projects running through cruisecontrol.net . As a part of the
When running some long integration test sequences, we stub Time to have controllable relative
I'm running some virtual machines using VMware workstation on my PC (using win 7),
I am running some tests for extjs library that we are using in our
Im running some tasks via django-celery (with rabbitmq as backend), the tasks are time
I'm running some unsecure code which I have set its stdout and stderr streams
During the running of my XSLT 2.0 stylesheet, I have need to find certain
I have been running some tests to find out why some CSS margins collapse
I'm using XSLT to pull some data from child nodes in an Umbraco (4.7)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.