Deactivate online validation schemas

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Frank Ralf
Posts: 407
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Deactivate online validation schemas

Post by Frank Ralf » Thu Feb 13, 2020 6:16 pm

Hi,

When using Oxygen 21.1 for the first time I got asked whether Oxygen can fetch validation schemas from remote URLs. I have agreed to trust all sources but now want to change this because I'm using Oxygen in a restricted environment with no internet access. How can I do this?

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com

Radu
Posts: 7024
Joined: Fri Jul 09, 2004 5:18 pm

Re: Deactivate online validation schemas

Post by Radu » Fri Feb 14, 2020 12:53 am

Hi Frank,

You can look in the Preferences->"Network Connection Settings / Trusted Hosts" page and remove from there the trusted hosts.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Frank Ralf
Posts: 407
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Deactivate online validation schemas

Post by Frank Ralf » Mon Feb 17, 2020 6:47 pm

Hi Radu,

Many thanks for the pointer!

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com

Frank Ralf
Posts: 407
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Prevent FOP from validating SVG files

Post by Frank Ralf » Fri Mar 20, 2020 7:22 pm

Hi Radu,

I found out that the culprit isn't Oxygen but the FOP processor that tries to validate each SVG file against an online DTD.

Code: Select all

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
I've found a post from Ixiasoft with a suggested solution. However, I haven't found out yet which XML catalog file to modify in our custom Oxygen framework or PDF plugin. Actually, I'm not even sure whether Apache FOP uses any of the XML catalog files from either Oxygen or the DITA-OT to resolve the SVG URN.

I suppose this is related to the following known issue:
external-graphic_src_uri.xml (Test case with HTTP URL):
Doesn't work behind a proxy which requires authorization.
Any pointer welcome.

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com

Radu
Posts: 7024
Joined: Fri Jul 09, 2004 5:18 pm

Re: Deactivate online validation schemas

Post by Radu » Sat Mar 21, 2020 9:23 am

Hi Frank,

So you are using Apache FOP inside a DITA OT plugin to produce the PDF, right?
The <fop> task is defined in this build file:
DITA-OT/plugins/org.dita.pdf2.fop/build_fop.xml

Code: Select all

<fop format="${fop.formatter.output-format}" fofile="${pdf2.temp.dir}/topic.fo" basedir="${pdf2.temp.dir}"
         outfile="${outputFile}" messagelevel="info" relativebase="true" force="true"
         userconfig="${args.fo.userconfig}"/>
Looking at the parameter you can send to the FOP task:

https://xmlgraphics.apache.org/fop/2.4/anttask.html

there seems to be no parameter for XML catalog.

There are two things you could do:

1) Avoid having SVG documents with a DOCTYPE declaration inside them.
2) Replace in the build file the "<fop>" ANT task with a call to the FOP command line which does have an xml catalog parameter:
https://xmlgraphics.apache.org/fop/2.4/running.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Frank Ralf
Posts: 407
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Deactivate online validation schemas

Post by Frank Ralf » Fri Mar 27, 2020 1:44 pm

Hi Radu,

Many thanks for your answer! That definitely spared me a wild goose chase ;-)

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com

chrispitude
Posts: 201
Joined: Thu May 02, 2019 2:32 pm

Re: Deactivate online validation schemas

Post by chrispitude » Sun Mar 29, 2020 5:14 pm

Hi Radu,

Is this SVG schema-checking issue resolved in PDF Chemistry?

I've removed DOCTYPE from our existing SVG files, but writers will create new ones over time.

Frank Ralf
Posts: 407
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Deactivate online validation schemas: Batik Pretty Printer

Post by Frank Ralf » Tue Mar 31, 2020 12:01 pm

Hi,

I've seen that Apache Batik, the library for processing SVGs, comes with a Pretty Printer tool that could probably be used to modify or remove the doctype declaration of SVGs:
-doctype change | remove : Specifies whether the doctype should be changed or removed,
-publid-id string : Specifies the public ID to in the doctype declaration, when -doctype change is specified, and
-system-id string : Specifies the system ID to in the doctype declaration, when -doctype change is specified.
Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com

julien_lacour
Posts: 99
Joined: Wed Oct 16, 2019 3:47 pm

Re: Deactivate online validation schemas

Post by julien_lacour » Tue Mar 31, 2020 1:09 pm

Hello,

The problem is normally fixed in Oxygen 22.0, you can try on your side and see if the problem still occurs.

Regards,
Julien

Radu
Posts: 7024
Joined: Fri Jul 09, 2004 5:18 pm

Re: Deactivate online validation schemas

Post by Radu » Tue Mar 31, 2020 1:10 pm

Hi,

Julien's remark above is for the PDF publishing using CSS. The problem with the XSL-FO based publishing still remains.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Frank Ralf
Posts: 407
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Prevent FOP from validating SVGs

Post by Frank Ralf » Fri Jun 19, 2020 4:27 pm

Hi Radu,

We have only now come to try your suggestion by modifying org.dita.pdf2.fop\build_fop.xml as follows:

Code: Select all

<target name="transform.fo2pdf.fop" if="use.fop.pdf.formatter">
<!--    <taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop"/>-->
    
    <condition property="outputFile" value="${dita.output.dir}/${outputFile.base}${xsl.formatter.ext}">
      <not><isset property="outputFile"/></not>
    </condition>
    <mkdir dir="${dita.output.dir}"/>
    
<!--    <fop format="${fop.formatter.output-format}" fofile="${pdf2.temp.dir}/topic.fo" basedir="${pdf2.temp.dir}"
         outfile="${outputFile}" messagelevel="info" relativebase="true" force="true"
         userconfig="${args.fo.userconfig}"/>
-->
    <exec dir="V:\fop-2.3\fop" executable="V:\fop-2.3\fop\fop.bat">
      <arg line="-fo ${pdf2.temp.dir}/topic.fo -pdf ${outputFile} -catalog -c ${args.fo.userconfig}"/>
    </exec>

    <dita-ot-fail id="PDFX013F">
      <condition>
        <and>
          <equals arg1="${fop.failOnError}" arg2="true"/>
          <not>
            <available file="${outputFile}" type="file"/>
          </not>
        </and>
      </condition>
      <param name="1" value="${outputFile}"/>
    </dita-ot-fail>
  </target>
  
This indeed solved the problem of the SVG validation and sped PDF generation up tenfold.

However, some issues remain.
  1. We had to use a separate FOP (V:\fop-2.3\fop\fop.bat) because the FOP bundeled with the org.dita.pdf2.fop plugin doesn't come with the required batch script/shell script.
  2. We have not yet testet to run the jar file directly.
  3. Strangely, it doesn't seem to matter whether we set the -catalog parameter at all, because calling FOP from the command line seems to be enough to prevent the SVG validation. This would point to a general difference between the <fop> task and the <exec> task.
So now we are a little stuck on how best to proceed. Any pointers welcome.

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com

Frank Ralf
Posts: 407
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

FOP SVG validation: Jira bug

Post by Frank Ralf » Fri Jun 19, 2020 4:37 pm

Finally found the related bug in the FOP Jira. Dates from 2012, last updated 2016. Still open and unresolved.

FOP should provide SVG DTD
Frank Ralf
parson AG
www.parson-europe.com

Radu
Posts: 7024
Joined: Fri Jul 09, 2004 5:18 pm

Re: Deactivate online validation schemas

Post by Radu » Mon Jun 22, 2020 6:54 am

Hi Frank,

Sorry but I don't know why this difference between the FOP command line and using directly the FOP ANT task exists.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Frank Ralf
Posts: 407
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Deactivate online validation schemas

Post by Frank Ralf » Thu Jun 25, 2020 12:26 pm

Hi Radu,

Thanks for your reply. We keep investigating ;-)

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com

Post Reply