W3C home > Mailing lists > Public > xproc-dev@w3.org > June 2009

RE: Having problems with p:validate-with-relax-ng and Calabash

From: Philip Fennell <Philip.Fennell@bbc.co.uk>
Date: Wed, 3 Jun 2009 11:49:36 +0100
Message-ID: <F3685F4A877F284F8054E328390447D14C6EA7@bbcxues17.national.core.bbc.co.uk>
To: "XProc Dev" <xproc-dev@w3.org>
Norm,

Thanks for making me double check, I'd unpacked Jing in the wrong place,
but I've still got problems...


I've now had to get MSV and put that on the classpath too.

I'm using a RelaxNG Compact Syntax Schema and when I call
p:validate-with-relax-ng thus:


<p:validate-with-relax-ng name="structure" assert-valid="true">
  <p:input port="source" sequence="false"/>
  <p:input port="schema">
    <p:data href="schemata/wadl20090202.rnc"
content-type="application/relax-ng-compact-syntax"/>
  </p:input>
</p:validate-with-relax-ng>

I get:

[root@pal service-description]# ./bin/pipeline.sh
-oresult=results/java-client.atom -isource=examples/uploader.wadl
pipelines/service-description.xpl
org.iso_relax.verifier.VerifierConfigurationException: element "c:data"
is not allowed here
        at
com.sun.msv.verifier.jarv.FactoryImpl.compileSchema(FactoryImpl.java:107
)
        at
com.xmlcalabash.library.ValidateWithRNG.run(ValidateWithRNG.java:89)
        at com.xmlcalabash.runtime.XAtomicStep.run(XAtomicStep.java:364)
        at com.xmlcalabash.runtime.XPipeline.doRun(XPipeline.java:223)
        at com.xmlcalabash.runtime.XPipeline.run(XPipeline.java:130)
        at com.xmlcalabash.drivers.Main.run(Main.java:241)
        at com.xmlcalabash.drivers.Main.main(Main.java:65)

StackTrace of Original Exception:
org.iso_relax.verifier.VerifierConfigurationException: element "c:data"
is not allowed here
        at
com.sun.msv.verifier.jarv.TheFactoryImpl.parse(TheFactoryImpl.java:44)
        at
com.sun.msv.verifier.jarv.FactoryImpl.compileSchema(FactoryImpl.java:98)
        at
com.xmlcalabash.library.ValidateWithRNG.run(ValidateWithRNG.java:89)
        at com.xmlcalabash.runtime.XAtomicStep.run(XAtomicStep.java:364)
        at com.xmlcalabash.runtime.XPipeline.doRun(XPipeline.java:223)
        at com.xmlcalabash.runtime.XPipeline.run(XPipeline.java:130)
        at com.xmlcalabash.drivers.Main.run(Main.java:241)
        at com.xmlcalabash.drivers.Main.main(Main.java:65)

StackTrace of Original Exception:
com.sun.msv.verifier.jarv.FactoryImpl$WrapperException: element "c:data"
is not allowed here
        at
com.sun.msv.verifier.jarv.FactoryImpl$ThrowController.error(FactoryImpl.
java:145)
        at com.sun.msv.reader.Controller.error(Controller.java:51)
        at com.sun.msv.reader.Controller.error(Controller.java:51)
        at
com.sun.msv.reader.GrammarReader.reportError(GrammarReader.java:807)
        at
com.sun.msv.reader.GrammarReader.reportError(GrammarReader.java:765)
        at
com.sun.msv.reader.SimpleState.startElement(SimpleState.java:81)
        at
org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
        at
com.sun.msv.reader.trex.TREXBaseReader.startElement(TREXBaseReader.java:
184)
        at
com.sun.msv.reader.trex.ng.RELAXNGReader.startElement(RELAXNGReader.java
:524)
        at
com.sun.msv.reader.trex.ng.comp.RELAXNGCompReader.startElement(RELAXNGCo
mpReader.java:197)
        at
com.sun.msv.reader.util.GrammarLoader$2.startElement(GrammarLoader.java:
505)
        at
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scan
RootElementHook(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
        at
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at
com.sun.msv.reader.util.GrammarLoader._loadSchema(GrammarLoader.java:514
)
        at
com.sun.msv.reader.util.GrammarLoader.parse(GrammarLoader.java:325)
        at
com.sun.msv.reader.util.GrammarLoader.loadSchema(GrammarLoader.java:189)
        at
com.sun.msv.verifier.jarv.TheFactoryImpl.parse(TheFactoryImpl.java:42)
        at
com.sun.msv.verifier.jarv.FactoryImpl.compileSchema(FactoryImpl.java:98)
        at
com.xmlcalabash.library.ValidateWithRNG.run(ValidateWithRNG.java:89)
        at com.xmlcalabash.runtime.XAtomicStep.run(XAtomicStep.java:364)
        at com.xmlcalabash.runtime.XPipeline.doRun(XPipeline.java:223)
        at com.xmlcalabash.runtime.XPipeline.run(XPipeline.java:130)
        at com.xmlcalabash.drivers.Main.run(Main.java:241)
        at com.xmlcalabash.drivers.Main.main(Main.java:65)
Error  : Pipeline failed: com.xmlcalabash.core.XProcException:
org.iso_relax.verifier.VerifierConfigurationException: element "c:data"
is not allowed here
Error  : Underlying exception:
org.iso_relax.verifier.VerifierConfigurationException: element "c:data"
is not allowed here
[root@pal service-description]#


So, for some reason it's not dealing with the p:data properly.


However, if I try the XML Syntax version of the schema I get:

[root@pal service-description]# ./bin/pipeline.sh
-oresult=results/java-client.atom -isource=examples/uploader.wadl
pipelines/service-description.xpl
Error  : Pipeline failed: java.lang.ClassCastException:
com.thaiopensource.datatype.xsd.MaxInclusiveRestrictDatatype cannot be
cast to com.sun.msv.datatype.xsd.XSDatatype


Any thoughts?

Has anyone out there got an example that works?



Regards

Philip Fennell



-----Original Message-----
From: xproc-dev-request@w3.org [mailto:xproc-dev-request@w3.org] On
Behalf Of Norman Walsh
Sent: 02 June 2009 19:31
To: XProc Dev
Subject: Re: Having problems with p:validate-with-relax-ng and Calabash

Philip Fennell <Philip.Fennell@bbc.co.uk> writes:
> I get the following problem when using p:validate-with-relax-ng in a
> pipeline:
>
> [root@pal service-description]# ./bin/pipeline.sh 
> -oresult=results/java-client.atom -isource=examples/uploader.wadl 
> pipelines/service-description.xpl Exception in thread "main" 
> java.lang.NoClassDefFoundError:
> org/iso_relax/verifier/VerifierConfigurationException
[...]
> I have jing.jar on my class path and have also tried putting 
> isorelax.jar on there too but to no avail.
>
> Any clues as to what I need to do to solve this?

I would have expected isorelax.jar to do the trick. Can you double check
that it's in your classpath?

Also make sure your isorelax.jar contains the requested class:

$ jar vtf isorelax.jar |grep VerifierConfigurationException
  1681 Wed Jan 08 11:21:44 EST 2003
org/iso_relax/verifier/VerifierConfigurationException.class

                                        Be seeing you,
                                          norm

--
Norman Walsh <ndw@nwalsh.com> | What is familiar is what we are used
http://nwalsh.com/            | to; and what we are used to is most
                              | difficult to 'Know'--that is, to see as
                              | a problem; that is, to see as strange,
                              | as distant, as 'outside us'.-- Nietzsche

http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					
Received on Wednesday, 3 June 2009 10:50:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 June 2009 10:50:10 GMT