New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVDL validation #283

Open
nyraghu opened this Issue Oct 27, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@nyraghu

nyraghu commented Oct 27, 2018

I am unable to validate documents with NVDL. I am working with XML Calabash 1.1.22-98, and DocBook 5.1. This is the pipeline nvdl.xpl that I am using:

<?xml version="1.0" encoding="utf-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:pxp="http://exproc.org/proposed/steps"
                version="1.0">
  <p:input port="source" />
  <p:output port="result" />
  <p:import href="http://xmlcalabash.com/extension/steps/library-1.0.xpl" />

  <pxp:nvdl name="validate-nvdl">
    <p:input port="nvdl">
      <p:document href="/pkg/docbook/docbook.nvdl" />
    </p:input>
    <p:input port="schemas">
      <p:empty />
    </p:input>
  </pxp:nvdl>
</p:declare-step>

This is the test file test.xml that I am using:

<?xml version="1.0" encoding="utf-8"?>
<section xmlns="http://docbook.org/ns/docbook">
  <title>Test</title>
  <para>This document is valid with respect to the RNG schema.</para>
  <annotation>
    <annotation>
      <para>However, this annotation inside an annotation violates a
      Schematron rule.</para>
    </annotation>
  </annotation>
</section>

The command

java -cp /pkg/xmlcalabash/xmlcalabash-1.1.22-98.jar com.xmlcalabash.drivers.Main -i source=test.xml nvdl.xpl

produces the error

ERROR: SAX Exception
ERROR:     cause: no implementation available for schema language with namespace URI "http://purl.oclc.org/dsdl/schematron"
ERROR: SAX Exception
ERROR: Underlying exception: no implementation available for schema language with namespace URI "http://purl.oclc.org/dsdl/schematron"

I am able to validate the document using validate-with-relax-ng, and am getting the expected error using validate-with-schematron.

@nyraghu

This comment has been minimized.

nyraghu commented Oct 28, 2018

The problem seems to be related to this thread on the Oxygen XML Forum. According to it, the version of jing current in 2010 did not support ISO Schematron validation. The version of jing packaged by my OS (Linux Mint 18.1) is able to validate the file properly:

$ jing /pkg/docbook/docbook.nvdl test.xml 
/home/raghu/xml-sandbox/xproc-nvdl/test.xml:5: error: assertion failed:
  annotation must not occur among the children or descendants of annotation

$ jing | grep -i 'version'
Jing version 20131210

The version in the XML Calabash lib directory is jing-20091111.jar. Is it possible to replace it with a more recent version?

@nyraghu

This comment has been minimized.

nyraghu commented Oct 28, 2018

Using jing built from its GitHub source works better:

$ java -cp /home/raghu/Downloads/jing-trang/build/jing.jar:/pkg/xmlcalabash/xmlcalabash-1.1.22-98.jar com.xmlcalabash.drivers.Main -i source=test.xml nvdl.xpl

Warning at char 3 in xsl:param/@select on line 459 column 43 
  SXWN9000: The parent axis starting at a document node will never select anything

error: assertion failed:
  annotation must not occur among the children or descendants of annotation
ERROR: err:XC0053:XC0053
ERROR: It is a dynamic error if the assert-valid option is true and the input document is not valid.

$ java -jar /home/raghu/Downloads/jing-trang/build/jing.jar | grep -i version
Jing version 20151127

I don't know what the SXWN9000 warning means. The response is as expected modulo that warning.

@ndw

This comment has been minimized.

Owner

ndw commented Oct 28, 2018

Ok. Thanks for doing the research. I noticed just this week that a recent version of jing/trang don’t seem to be in any of the common repositories. I’ll see about bundling it with the next XML Calabash release.

@nyraghu

This comment has been minimized.

nyraghu commented Oct 28, 2018

The one at https://github.com/relaxng/jing-trang has version 20151127 which seems recent enough for this problem.

@ndw

This comment has been minimized.

Owner

ndw commented Oct 29, 2018

Yes, but it's not on a public Maven repo, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment