Ant errors

Having trouble installing Oxygen? Got a bug to report? Post it all here.
scottbdr
Posts: 50
Joined: Tue Jul 21, 2009 1:48 am

Ant errors

Post by scottbdr »

Hi, I had a transformation that used an Ant script to do a few things with a zip file and run a transformation on a XML file contained within. When I updated to v26 this script started throwing the following errors:

Code: Select all

Processing C:\Users\seb9911\repositories\oxygen-frameworks\das-frameworks\ddmf\ddmf_package\examples\DOC_PDFC_TBC-TBX_D6-17370_20201005T070000Z_20201006T003033Z.ZIP ...
Warning: org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.
Warning: org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.

...

Error parsing XPath expression 'meta[@property eq 'dms:priorPackageName']'.
The warnings appear to be a known bug with JRE/Xerces - I don't know that it's causing the failure. However the XPath error I can't account for. If I change the 'eq' to just a '=', I get another odd XSL error about needing a select statement that's already there. Is your Ant configuration defaulting to Xerces for it's transformation engine? I get a similar sort of error about the 'eq' operator when I run the XSL using Xerces outside the Ant script. I tried to point to the Oxygen framework Saxon jar in the Ant script (using a classpath and XsltClassname), but your patched version doesn't seem to have net.sf.saxon.TransformerFactoryImpl, so wasn't sure how to configure otherwise.
xephon
Posts: 140
Joined: Mon Nov 24, 2014 1:49 pm
Location: Greven/Germany

Re: Ant errors

Post by xephon »

If you are not using a DITA-OT transformstion, you might not have Saxon HE on the classpath. You can add it like so:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<project>
    <path id="saxon">
        <fileset dir="../../lib/">
            <include name="saxon.jar"/>
        </fileset>
    </path>
</project>
Of course, you need to provide the saxon.jar file (Saxon HE). Afterwards you can use Saxon in an XSLT task like so:

Code: Select all

            <xslt style="script.xsl"
                in="input.xml"
                out="output.xml"
                failOnError="true">
                <factory name="net.sf.saxon.TransformerFactoryImpl"/>
                <classpath refid="saxon"/>
            </xslt>
            
stefan-jung.org – Your DITA/DITA-OT XML consultant
xephon
Posts: 140
Joined: Mon Nov 24, 2014 1:49 pm
Location: Greven/Germany

Re: Ant errors

Post by xephon »

stefan-jung.org – Your DITA/DITA-OT XML consultant
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Ant errors

Post by Radu »

Hi,
I agree with this being a problem in which the Saxon XSLT processor library is not properly loaded by the ANT build file.
If you have an Oxygen ANT transformation scenario that you are running maybe you can edit it and click the "Libraries" button to see what JAR libraries are used by it, then if Saxon JAR libraries are used directly from the Oxygen installation folder double check that the name of the Saxon JAR library has not changed between Oxygen released. For example Oxygen 26 comes with a JAR library named "oxygen-patched-saxon-12.jar" in its "OXYGEN_INSTALL_DIR/lib" folder. But older Oxygen versions contained an older version of Saxon, possibly Saxon 11 for example.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
scottbdr
Posts: 50
Joined: Tue Jul 21, 2009 1:48 am

Re: Ant errors

Post by scottbdr »

Thanks Radu, that got it - the Libraries included a path like ${oxygenHome}/lib/*saxon*11*.jar for saxon 9-11, but not one for 12. Adding one for 12 solved the problem. I'll have to keep an eye out for Saxon upgrades going forward. Thanks for the quick response as usual!

Scott
Post Reply