turning off validation in saxonb8-7j
Added by Anonymous over 18 years ago
Legacy ID: #3667954 Legacy Poster: Don Brutzman (brutzman)
i'm using saxon via ant to validate a lot of xml files. performance seems pretty slow. turning off the network started throwing exceptions. there shouldn't be any need for Saxon to access the network. tried the -v switch but that had no apparent effect... reading the docs indicates it is for turning on DTD validation. in this case, i want to turn it off. didn't see anything different in the mail archives. alternatively, it would be helpful to have a DTD Catalog capability to provide a local alternative file instead of online DTD urls. All advice welcome, TIA.
Replies (2)
RE: turning off validation in saxonb8-7j - Added by Anonymous over 18 years ago
Legacy ID: #3667959 Legacy Poster: Don Brutzman (brutzman)
ant invocation excerpt follows. first three macro definitions are nearly identical, final iterator merely invokes them. <!-- excerpted/adapted from "SAXON XSLT Processing with Ant" by James Fuller, http://ablog.apress.com/?p=753 --> <macrodef name="X3dToXhtml" description="Invoke X3dToXhtml.xslt using passed parameters"> <attribute name="scene"/> <sequential> <echo>Processing @{scene} with X3dToXhtml</echo> <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/saxon8.jar;." fork="true" failonerror="false"> <!--<arg value="-t"/> timing information --> <arg value="-w1"/> <!-- recover after writing a warning message --> <arg value="-c"/> <!-- compiled stylesheet --> <arg value="-v"/> <!-- validation, hopefully off... --> <arg value="-o"/> <arg value="@{scene}.html"/> <arg value="@{scene}.x3d"/> <arg value="../../X3dToXhtml.sxx"/> <!-- compiled stylesheet --> <!--<arg value="../../X3dToXhtml.xslt"/> --> </java> </sequential> </macrodef> <macrodef name="X3dToVrml97" description="Invoke X3dToVrml97.xslt using passed parameters"> <attribute name="scene"/> <sequential> <echo>Processing @{scene} with X3dToVrml97</echo> <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/saxon8.jar;." fork="true" failonerror="false"> <!--<arg value="-t"/> timing information --> <arg value="-w1"/> <!-- recover after writing a warning message --> <arg value="-c"/> <!-- compiled stylesheet --> <arg value="-o"/> <arg value="@{scene}.html"/> <arg value="@{scene}.x3d"/> <arg value="../../X3dToVrml97.sxx"/> <!-- compiled stylesheet --> <!--<arg value="../../X3dToXhtml.xslt"/> --> </java> </sequential> </macrodef> <macrodef name="X3dToX3dvClassicVrmlEncoding" description="Invoke X3dToX3dvClassicVrmlEncoding.xslt using passed parameters"> <attribute name="scene"/> <sequential> <echo>Processing @{scene} with X3dToX3dvClassicVrmlEncoding</echo> <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/saxon8.jar;." fork="true" failonerror="false"> <!--<arg value="-t"/> timing information --> <arg value="-w1"/> <!-- recover after writing a warning message --> <arg value="-c"/> <!-- compiled stylesheet --> <arg value="-o"/> <arg value="@{scene}.html"/> <arg value="@{scene}.x3d"/> <arg value="../../X3dToX3dvClassicVrmlEncoding.sxx"/> <!-- compiled stylesheet --> <!--<arg value="../../X3dToXhtml.xslt"/> --> </java> </sequential> </macrodef> <target name="processScenes.SaxonIterator"> <for param="filenames"> <fileset dir="."> <include name="**/.x3d"/> </fileset> <sequential> <propertyregex property="filename.prefix" override="true" input="@{filenames}" regexp="([^\\]\){6}([^\.]*).x3d" select="\2"/> <echo>filenames=@{filenames}, filename.prefix=${filename.prefix}</echo> <X3dToXhtml scene="${filename.prefix}"/> <X3dToVrml97 scene="${filename.prefix}"/> <X3dToX3dvClassicVrmlEncoding scene="${filename.prefix}"/> </sequential> </for> </target>
RE: turning off validation in saxonb8-7j - Added by Anonymous over 18 years ago
Legacy ID: #3668108 Legacy Poster: Michael Kay (mhkay)
It sounds as if your source documents contain links to DTDs held remotely on the network. The XML parser (not Saxon itself!) will follow these links to find the DTD, whether or not you request validation. This is because DTDs do more than validation: they contain entity definitions, attribute type definitions, and default attribute values. For advice on using catalogs, see http://www.dpawson.co.uk/docbook/catalogs.html
Please register to reply