Problem to use a catalog with ANT script
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 8
- Joined: Tue Jan 27, 2015 2:36 pm
Problem to use a catalog with ANT script
Hello,
I would like to use a XML catalog in my ANT script. See below an extract of my script :
I tried to put the acces to resolver but it didn't work. I have always this message "Warning: XML resolver not found; external catalogs will be ignored"
See below the complete trace of my script :
Thank you for your help
I would like to use a XML catalog in my ANT script. See below an extract of my script :
Code: Select all
<xmlvalidate failonerror="yes" lenient="no" warn="yes"
classname="org.apache.xerces.parsers.SAXParser">
<classpath location="../tools/xercesImpl.jar"/>
<classpath location="../apache-ant-1.9.6/lib/ant-apache-resolver.jar"/>
<fileset dir="${outdir}" includes="*.ata"/>
<!--<property name="http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"
value="${xsd.file}"/>-->
<attribute name="http://apache.org/xml/features/validation/schema" value="true"/>
<attribute name="http://xml.org/sax/features/namespaces" value="true"/>
<xmlcatalog>
<catalogpath path="..\catalog.xml" location="..\catalog.xml"/>
</xmlcatalog>
</xmlvalidate>
See below the complete trace of my script :
Code: Select all
Executing:
"c:\mesprogrammes\oxygen xml editor 16\jre/bin/java" -Xmx256m -classpath "C:\Mesprogrammes\Oxygen XML Editor 16\tools\ant/lib/ant-launcher.jar" "-Dant.home=C:\Mesprogrammes\Oxygen XML Editor 16\tools\ant" org.apache.tools.ant.launch.Launcher -lib "C:\Mesprogrammes\Oxygen XML Editor 16\tools\ant\lib\ant-apache-resolver.jar" -f "S1000d2Ata.xml" "-Dmanuel=ESM" "-Dwebhelp.trial.license=no"
Buildfile: C:\Users\jvanhille\Documents\SNECMA\03-DEVELOPPEMENT\INDIGO\BATCHConverter\build\S1000d2Ata.xml
[echo] DEBUT C:\Users\jvanhille\Documents\SNECMA\03-DEVELOPPEMENT\INDIGO\BATCHConverter\DATA\INPUT_ESM
[xslt] Transforming into C:\Users\jvanhille\Documents\SNECMA\03-DEVELOPPEMENT\INDIGO\BATCHConverter\DATA\OUTPUT_ESM
Warning: XML resolver not found; external catalogs will be ignored
[xmlvalidate] C:\Users\jvanhille\Documents\SNECMA\03-DEVELOPPEMENT\INDIGO\BATCHConverter\DATA\OUTPUT_ESM\procedure_DMC-LEAP-1C-722413-01A-250A-C_000-01_SX-US_DELETED.ata:1:480: schema_reference.4: Failed to read schema document 'http://www.snecma.com/techpub/schemas/ata/em.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
[xmlvalidate] C:\Users\jvanhille\Documents\SNECMA\03-DEVELOPPEMENT\INDIGO\BATCHConverter\DATA\OUTPUT_ESM\procedure_DMC-LEAP-1C-722413-01A-250A-C_000-01_SX-US_DELETED.ata:1:480: cvc-elt.1: Cannot find the declaration of element 'task'.
[xmlvalidate] C:\Users\jvanhille\Documents\SNECMA\03-DEVELOPPEMENT\INDIGO\BATCHConverter\DATA\OUTPUT_ESM\procedure_DMC-LEAP-1C-722413-01A-250A-C_000-01_SX-US_DELETED.ata:1:480: schema_reference.4: Failed to read schema document 'http://www.snecma.com/techpub/schemas/ata/em.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
[xmlvalidate] C:\Users\jvanhille\Documents\SNECMA\03-DEVELOPPEMENT\INDIGO\BATCHConverter\DATA\OUTPUT_ESM\procedure_DMC-LEAP-1C-722413-01A-250A-C_000-01_SX-US_DELETED.ata:1:480: schema_reference.4: Failed to read schema document 'http://www.snecma.com/techpub/schemas/ata/em.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
The process finished with exit code: 1
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Problem to use a catalog with ANT script
Hi,
So specifying the path to the catalog something like this:
should work both when running the script on Linux and Windows operating systems.
Of course the path is usually relative to the base directory of the build file.
Usually on the <project> root element of the build file you can add an attribute like:
to signal that the place where the build file is located is the base folder for all relative references. But possibly this is also the default behavior.
One more thing, if you edit the ANT transformation scenario in Oxygen, in the Options tab it has a Libraries button. Could you add to that list the references to the Xerces and Resolver libraries that you added in the build file?
Because I'm not sure that just specifying the classpath in the xmlvalidate will actually load those JAR libraries in the ANT process class loader.
Regards,
Radu
So specifying the path to the catalog something like this:
Code: Select all
<xmlcatalog>
<catalogpath>
<pathelement location="../catalog.xml"/>
</catalogpath>
</xmlcatalog>
Of course the path is usually relative to the base directory of the build file.
Usually on the <project> root element of the build file you can add an attribute like:
Code: Select all
basedir="."
One more thing, if you edit the ANT transformation scenario in Oxygen, in the Options tab it has a Libraries button. Could you add to that list the references to the Xerces and Resolver libraries that you added in the build file?
Because I'm not sure that just specifying the classpath in the xmlvalidate will actually load those JAR libraries in the ANT process class loader.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 8
- Joined: Tue Jan 27, 2015 2:36 pm
Re: Problem to use a catalog with ANT script
Hi Radu,
Thank you for your help.
You're right, when I specified the location of the resolver like this . It didn't work. When I added it with ant option -lib it works.
But previously I didn't use the correct library. I used and it was not correct.
It has to be used.
Best Regards
Thank you for your help.
You're right, when I specified the location of the resolver like this
Code: Select all
<classpath location="../tools/resolver.jar"/>
But previously I didn't use the correct library. I used
Code: Select all
ant-apache-resolver.jar
It has to be used
Code: Select all
resolver.jar
Best Regards
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service