cngkaygusuz / probatron4j Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/probatron4j
Automatically exported from code.google.com/p/probatron4j
What steps will reproduce the problem?
1. /Library/Java/Home/bin/java -jar /Users/syd/bin/probatron.jar -r1 -n1
sourceFile.xml rulesFile.sch 2> /dev/null | xmllint --format - | egrep -i debug
2. [See attached files sourceFile.xml, rulesFile.sch, dataFile.xml]
What is the expected output? What do you see instead?
[See attached file resultsFile.txt]
What version of the product are you using? On what operating system?
Probatron4J on Mac OS X 10.5.8 running the following java:
|java version "1.5.0_20"
|Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_20-b02-315)
|Java HotSpot(TM) Client VM (build 1.5.0_20-141, mixed mode, sharing)
Please provide any additional information below.
See postings to the schematron-love-in mailing list
(https://lists.sourceforge.net/lists/listinfo/schematron-love-in) of today
with subject 'canonical method to say "pointing to a <foo>"'.
Original issue reported on code.google.com by [email protected]
on 10 Sep 2009 at 11:30
Attachments:
It appears, but is perhaps not very meaningful.
Original issue reported on code.google.com by [email protected]
on 19 Apr 2010 at 3:28
User has requested allowing specification of multiple phases per run.
Original issue reported on code.google.com by [email protected]
on 20 Oct 2009 at 8:01
IMHO, the current version of Probatron4J is specifically designed for
command line usages. It is not very usable from the java code.
The expectations that I have from Probatron4J is -
Should take a xml document and schematron schema, validate the document
against schema and return result in the form of an object.
The object (say ValidationResult) should have a method which tells whether
validation is successful and another method to return list of error messages.
I tried to use the SchematronSchema class to do the validation for me.
The problems that I faced are -
1. The SchematronSchema.validateCandidate(URL url) method takes URL of the
candidate xml document. This is useful if the xml to be verified is a file
or URL. However, in the java code, the xml is likely to be in the form of a
String or stream. There is no way to convert string to URL, without
writting the string to a file and its a bad solution.
SchematronSchema has a validateCandidate(InputStream is) method, but it is
private.
2. After validation, validateCandidate() method returns ValidationReport
object which holds the bytes for the complete report XML. There is no class
in probatron jar which helps to retrieve error messages from this report XML.
Solutions that I propose -
1. Make SchematronSchema.validateCandidate(InputStream is) method public,
so that xml which is in the form of String can be passed for validation. We
can also create a overloaded method which takes string.
2. Provide a mechanism to get the validation result in the form of a object
with the list of error messages.
To do this, we need to create a Document object from the result stream and
then apply the XPath '//failed-assert/text/text()' to get the error messages.
I am using 0.7.1 version of Probatron4J.
Please let me know your opinion. I can provide the patch for the required
changes.
Original issue reported on code.google.com by [email protected]
on 16 Sep 2009 at 4:26
Hi,
At line 59, of the Utils.java, it changes the system property
'javax.xml.transform.TransformerFactory'
System.setProperty( PROPERTY_TRAX_IMPLEMENTATION, SAXON_TRAX_CLASS );
It creates problem when the system uses another impl. TransformerFactory.
It is unexpected behavior and creates side-effect
Kind regards
Original issue reported on code.google.com by [email protected]
on 11 Mar 2014 at 10:01
For version 0.7.0, <failed-assert> elements have bad XPaths (i.e. they
cointain the Namespace URI in curly brackets rather than a prefix).
Original issue reported on code.google.com by [email protected]
on 8 Jun 2009 at 11:53
What steps will reproduce the problem?
1. Schema (testSchema.sch) contains:
<schema xmlns="http://purl.oclc.org/dsdl/schematron">
<include href="testSchema-include.sch"></include>
<pattern name="...">...</pattern>
</schema>
2. Included schema contains
<pattern name="..." xmlns="http://purl.oclc.org/dsdl/schematron">...</pattern>
3. Run probatron:
java -jar "probatron.jar" testDocument.xml testSchema.sch
4. Try again with absolute file path in the @href attribute (both
"file:/C:/..." and "file:///C:/...")
What is the expected output? What do you see instead?
Error message appears:
Recoverable error on line 359
FODC0002: java.net.MalformedURLException
Unable to open referenced included file: testSchema-include.sch
Unable to locate id attribute: testSchema-include.sch
Then the output of just the <pattern> in the main schema appears.
What version of the product are you using? On what operating system?
Probatron4j 0.7.1
Java 1.6.0_03
Windows XP Professional SP 2
The schema was successfully compiled with Saxon using the standard
iso_dsdl_include.xsl stylesheet
Original issue reported on code.google.com by [email protected]
on 28 Jul 2009 at 8:31
I'm using probatron programatically in a jar, with the schematron file
included. Inside the schematron, I'm using a reference to another file that
contains a list of accepted values :
<iso:report test="document('./annex.xml')...>
When running probatron from the command line, with the schematron and
include file in the same folder, I have no issues at all.
However, when I try to use it programatically, the schematron.sch and
annex.xml files are located in :
src/main/resources/sch/
After the build, the classes folder structure is as follows :
bar/foo/myClass.class
sch/schematron.sch
sch/annex.xml
Within the code, I use the following to set the schemadoc :
URL schemaLocation =
SumehrValidator.class.getResource(SCHEMATRON_FILE_NAME);
theSession.setSchemaDoc(schemaLocation.toString());
Now, when I perform theSession.doValidation(filename), I get a
FileNotFoundException :
Recoverable error on line 1011
FODC0002: java.io.FileNotFoundException:
C:\eclipse\workspace\bar\foo\annex.xml (The system cannot find
the file specified)
As the included file is in the same directory as the schematron file, is
there a way to prevent the system from looking in the jar's root folder ?
Original issue reported on code.google.com by [email protected]
on 28 Apr 2010 at 9:42
What steps will reproduce the problem?
1. Schema (spatialObservation.sch) contains
<xsl:import-schema
schema-location="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
<xsl:import-schema
schema-location="http://schemas.opengis.net/om/2.0/observation.xsd"/>
2. Run probatron:
java -jar probatron.jar spatial_observation1.xml spatialObservation.sch
3.
What is the expected output? What do you see instead?
probatron only support Basic XSLT Processor ?
Error at xsl:import-schema on line 34 column 87
XTSE1650: To use xsl:import-schema, you need the schema-aware version of Saxon from
http://www.saxonica.com/
What version of the product are you using? On what operating system?
Java jdk1.6.0_20
Windows XP Professional
Please provide any additional information below.
Exception in thread "main" java.lang.RuntimeException: Cannot instantiate XSLT
transformer, or tra
formation failure: Failed to compile stylesheet. 3 errors detected.
at org.probatron.SchematronSchema.validateCandidate(Unknown Source)
at org.probatron.SchematronSchema.validateCandidate(Unknown Source)
at org.probatron.Session.doValidation(Unknown Source)
at org.probatron.Driver.main(Unknown Source)
Caused by: javax.xml.transform.TransformerConfigurationException: Failed to
compile stylesheet. 3
Original issue reported on code.google.com by [email protected]
on 6 Apr 2014 at 2:52
Attachments:
Hello,
I need to validate an xml file using a xslt transformer and of course a
schematron schema. When I try to run probatron.jar without my custom xslt file,
it gives me that error :
Error at xsl:stylesheet on line 297 column 31
XTSE0010: Element xsl:stylesheet must not appear directly within xsl:stylesheet
FATAL Failed to compile stylesheet. 27 errors detected.
Exception in thread "main" java.lang.RuntimeException: Cannot instantiate XSLT
transformer, or trans
formation failure: Failed to compile stylesheet. 27 errors detected.
at org.probatron.SchematronSchema.validateCandidate(Unknown Source)
at org.probatron.SchematronSchema.validateCandidate(Unknown Source)
at org.probatron.Session.doValidation(Unknown Source)
at org.probatron.Driver.main(Unknown Source)
Caused by: javax.xml.transform.TransformerConfigurationException: Failed to
compile stylesheet. 27 e
rrors detected.
at net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:176)
at net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:139)
at net.sf.saxon.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:91)
... 4 more
I also need to run validation through java code, I have tried some samples but
I couldn't manage to run validation for my local xml and schema from code. Can
you please show me a snippet to run validation. Thanks in advance.
Original issue reported on code.google.com by [email protected]
on 14 Aug 2013 at 7:04
i have a schematron file and xml file.
What is the expected output? What do you see instead?
i need to see schematron error but not found
What version of the product are you using? On what operating system?
0.7.4
Please provide any additional information below.
at the schema there is a rule
<assert test="not(gl-cor:documentNumber) or gl-cor:documentType">error</assert>
the first entry detail have that condition buth probatron not found it.
Original issue reported on code.google.com by [email protected]
on 16 Dec 2014 at 11:44
Attachments:
tried to run
java -jar probatron.jar
https://www.seegrid.csiro.au/subversion/GeoSciML/branches/3.0.0/instances/TB4_GS
C_WaterAnalytical_isotopes_swe.xml
https://www.seegrid.csiro.au/subversion/GeoSciML/branches/3.0.0/schematron/GeoSc
iML_v3_Testbed_4.sch
and got
FATAL java.lang.IllegalArgumentException: Cannot register a prefix or Namespace
name that has already been registered
java.lang.IllegalArgumentException: Cannot register a prefix or Namespace name
that has already been registered
at org.probatron.NamespacePrefixMappings.registerMapping(Unknown Source)
at org.probatron.LocationMapHandler.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startEle
ment(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.
emptyElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scan
StartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(U
nknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown So
urce)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Un
known Source)
at org.probatron.ValidationReport.annotateWithLocators(Unknown Source)
at org.probatron.Session.doValidation(Unknown Source)
at org.probatron.Driver.main(Unknown Source)
Exception in thread "main" java.lang.RuntimeException: Cannot register a prefix
or Namespace name that has already been registered
at org.probatron.ValidationReport.annotateWithLocators(Unknown Source)
at org.probatron.Session.doValidation(Unknown Source)
at org.probatron.Driver.main(Unknown Source)
Original issue reported on code.google.com by [email protected]
on 14 Aug 2012 at 3:20
Collides with supposed unique string substitution values used internally
Original issue reported on code.google.com by [email protected]
on 10 Nov 2009 at 12:09
With a document such as
<foo bar='blort'/>
and schema rule
<rule context='@bar'>
<report test='.'/>
</rule>
the node is reported as e.g.
<successful-report test='.' location='blort'/>
Original issue reported on code.google.com by [email protected]
on 14 Aug 2009 at 9:06
currently is app folder; probably should be schema document (spec?)
Original issue reported on code.google.com by [email protected]
on 10 Nov 2009 at 3:55
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.