Giter VIP home page Giter VIP logo

schematron's People

Contributors

rjelliffe avatar trentbartlem avatar

Watchers

 avatar

schematron's Issues

Validate branches of a document

Allow a command-line parameter to validate branches of a document.

Paul Grosso of PTC has requested this and has code to provide. A new parameter 
root-node-to-validate-xpath parameter  is used. 

Original issue reported on code.google.com by [email protected] on 9 Jul 2010 at 5:58

Re-base sch:include and sch:extends

Includes and extends need to support rebasing in some way.

Requested by Lars Hutter, see 
http://www.eccnet.com/pipermail/schematron/2010-July/000285.html

Original issue reported on code.google.com by [email protected] on 9 Jul 2010 at 6:04

Issue with iso_svrl_for_xslt2.xsl producing XSL where rules don't fire.

What steps will reproduce the problem?
1.Generate XSL for the following schematron: 
https://github.com/rackspace/wadl-tools/blob/master/xsd/wadl.sch
2.When run against a WADL such as: 
https://github.com/openstack/compute-api/blob/master/openstack-compute-api-2/src
/os-compute-2.wadl  none of the none of the rules fire.

What is the expected output? What do you see instead?

Rules should fire.

What version of the product are you using? On what operating system?

Latest trunk, on OS X with latest Saxon-EE

Please provide any additional information below.

The following customization fixes the issue:

<?xml version="1.0" ?>

<xsl:stylesheet
   version="2.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias"
>

<xsl:import href="iso_svrl_for_xslt2.xsl"/>

<xsl:namespace-alias stylesheet-prefix="axsl" result-prefix="xsl"/>

<xsl:template name="process-prolog">
    <axsl:template match="@*|node()" mode="#all">
        <axsl:apply-templates select="@*|node()" mode="#current"/>
    </axsl:template>
</xsl:template>

</xsl:stylesheet>



Original issue reported on code.google.com by [email protected] on 8 Oct 2012 at 9:19

variables in let/@value are not replaced in abstract patterns

Variables used in <let> @value an abstract <pattern> are not replaced.

For <sch:assert>, <sch:p>, <sch:rule>, and <sch:value-of> the variables are 
replaced with the values from the corresponding <param> values from the 
concrete "@is-a" pattern. 

However, with the <sch:let>, when using a variable as the value of the 
<sch:let> in the abstract pattern (e.g. <sch:let name="test" 
value="$variableToSpecifyWithParam" />) and then specify a <param> with a name 
that matches the variable (i.e. <param name="variableToSpecifyWithParam" 
value="true()"/>).

I found this blog entry that describes the issue and has a proposed resolution: 

http://itfundamentalist.blogspot.com/2009/03/schematron-stilesheets-wont-work-wi
th.html

Original issue reported on code.google.com by madshansen3 on 25 Oct 2010 at 3:20

When "@path" is included in a Schema file, an error is output.

What steps will reproduce the problem?

1. I want to create a Schematron validation function on Java and Saxon.
2. When I use a Schema file, such as the file "sample.sch" shown below.
3.

--sample.sch------------------------------------
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <phase id="General">
        <active pattern="sample"/>
    </phase>
    <pattern id="sample">
        <rule context="*">
            <assert test="if (empty(@xml:lang)) then true()
                                else string(@xml:lang) = ('en', 'ja-JP')">
                <name path="@xml:lang"/> attribute value must be "en" or "ja-JP".
            </assert>
        </rule>
    </pattern>
</schema>
------------------------------------------------

What is the expected output? What do you see instead?

The following error is output:
"Bad name element: XPath error. No XPath."


What version of the product are you using? On what operating system?

http://schematron.googlecode.com/files/iso-schematron-xslt2.zip
OS:Windows 7 Professional SP1
Java:jre-7u51-windows-i586.exe
Saxon:saxonb9-1-0-8j


Please provide any additional information below.

In the file iso_dsdl_include_xsl, is it okay to use (B) instead of (A)?
(A) <xslt:template match="iso:name[@path]" mode="dsdl:go">...<xsl:with-param 
name="string" select=" @select "  />
(B) <xslt:template match="iso:name[@path]" mode="dsdl:go">...<xsl:with-param 
name="string" select=" @path "  />

Also, is there a better way do this?

Original issue reported on code.google.com by [email protected] on 21 Apr 2014 at 1:26

problem with running XSLT2 schematron

What steps will reproduce the problem?
1. using a schematron schema with queryBinding="xslt2"
2.
3.

What is the expected output? What do you see instead?
I'd expect it to run, but I get:
[schematron] Fail: This implementation of ISO Schematron does not work with 
[schematron]    schemas using the "xslt2" query language.
[schematron] Processing terminated by xsl:message at line 567 in 
iso_schematron_skeleton_for_xslt1.xsl

BUILD FAILED
/home/user/workspace/dir/myScript.xml:24: The validator could not be initialised


What version of the product are you using? On what operating system?
ant-schematron-2010-04-14  on Ubuntu 10.10 using Sun Java 1.6 in Eclipse 
'Helios'

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 12 Dec 2010 at 3:41

Ant-schematron : using XML Catalog with "doctyped" xml files

Hi, 

I ran "google.code.schematron\trunk\ant-schematron\test\ant\build.xml" with 
target "ant test-resolver-1"

Everything is fine from the original declared target : 
<!-- Resolver -->
<target name="test-resolver-1" description="Simple test">
    <taskdef name="schematron" classname="com.schematron.ant.SchematronTask" classpath="../lib/*.jar"/>
    <schematron schema="../schemas/test.sch" file="../xml/test1.xml" failonerror="false"
    debugmode="true"  resolver="org.apache.xml.resolver.tools.CatalogResolver"

    classpath="../lib/resolver.jar" 
    catalog="xxx.xml" 

    fileNameParameter="XXX"  fileDirParameter="ABC"/>
</target>

but this target defines an non existent catalog (xxx.xml).

SO I defined a catalog.xml file which contains : 
<public publicId="-//DOG//EN" 
uri="file:///C:/google.code.schematron/trunk/ant-schematron/test/ant/dog.dtd"/>

It points to dod.dtd with absolute uri (file is located at the same level as 
the build.xml file).

See attached files.

I then added the following doctype to test1.xml : 
<!DOCTYPE Dog PUBLIC "-//DOG//EN" "dog.dtd">

And when running "ant test-resolver-1"
I get the following error : 
test-resolver-1:
[schematron] Error
[schematron] java.io.FileNotFoundException:
[schematron] C:\google.code.schematron\trunk\ant-schematron\test\xml\dog.dtd 
[schematron] DEBUG: error
[schematron] Could not validate document 
C:\google.code.schematron\trunk\ant-sche
xml\test1.xml
[schematron] java.io.FileNotFoundException: 
C:\google.code.schematron\trunk\ant-s
st\xml\dog.dtd (Le fichier spécifié est introuvable)
BUILD FAILED

It seems dog.dtd file is being searched in "../xml" folder, which indicates the 
catalog resolver didn't work.

In oXygen, I added the catalog.xml files in catalog list, and I can 
successfully validate test1.xml. 
Note that I need to add catalog/@prefer="public" in catalog.xml so it works.


Configuration : 

* OS : windows 7 Pro

* JAVA : java version "1.6.0_20"

* ANT : Apache Ant(TM) version 1.8.2 compiled on December 20 2010
(I define ANT_HOME variable)

* SCHEMATRON : I get the whole test files from mercurial repo on 2011-08-30, 
the ant-schematron/test/lib folder contains : 
ant-schematron.jar
resolver.jar
saxon8.jar
saxon9.jar
saxon9.jar.old
saxon9he.jar

* SAXON : saxon9he.jar is in my CLASSPATH. If not I get an ANT error message. 
Version is : Saxon-HE 9.2.1.1J from Saxonica

I know saxon need a few options to be fixed so it work with a catalog : 

-r "Use URIResolver class" has to be set to 
"org.apache.xml.resolver.tools.CatalogResolver" which seems to be parameted by 
schematron/@resolver attribute

But also :
-x "Use specified SAX parser for source" has to be set to 
"file:org.apache.xml.resolver.tools.ResolvingXMLReader"

-y "Use specified SAX parser for stylesheet" also has to be set to 
"file:org.apache.xml.resolver.tools.ResolvingXMLReader"

But I don't see any attributes to set these parameters in the pdf doc  ("Using 
Schematron for Ant.pdf"). 
By the way, in this PDF, i think there is a mistake at parameter 
"xml.catalog.files" which should be "catalog" (attribute to schematron element)


Any help welcome !
(maybe I should post this on another place, but I can't find where ?)

Best Regards,
Matthieu

Original issue reported on code.google.com by [email protected] on 1 Sep 2011 at 9:53

Attachments:

document-uri() problem in XSLT1 schema when generated by XSLT2 engine

Lars Hutter has reported the old problem of stylesheet versions caused some 
problem. See discussion at 
http://www.eccnet.com/pipermail/schematron/2010-July/000295.html   

There are two problems:

1) Should @queryBinding="xslt2" cause a stylesheet with @version="2.0". 

According the draft ISO standard binding for XSLT2, backward compatibility 
should be false. See Annex L, http://www.itscj.ipsj.or.jp/sc34/open/1419.pdf So 
that suggests that certainly 2.0 should be generated. (Need to check it is.)

2) The svrl for saxon script generates  document-uri() function even for 
@queryLanguage="XSLT1" schemas. This is good for people then running the XSLT1 
script on SAXON: it allows better reporting, but will fail on XSLT1 systems.  
Sometimes people cross-compile, for example when the compiled stylesheet will 
run on IE attached to an XHTML document. 

At the moment there is some source code comment to delete document-uri(), but 
this requires hacking which we need to get beyond, even if it is an edge-case. 

Need to figure out better system: a command-line switch is one more thing to 
think about?, some use of xsl:fallback maybe?, or what?

Original issue reported on code.google.com by [email protected] on 10 Jul 2010 at 5:01

Schematron from ant doesn't respect class path definitions for file

What steps will reproduce the problem?
1. Running the schematron task without saxon defined in the system classpath

See 
http://stackoverflow.com/questions/23132201/setting-ant-classpath-in-build-xml 
for someone [else]'s description of and proposed solution to the problem.

This is an issue when you can't define the classpath for saxon ahead of running 
an ant script.

Original issue reported on code.google.com by [email protected] on 20 Jul 2014 at 3:43

Not getting results from manual pipeline processing through Schematron transforms...

What steps will reproduce the problem?
1 Manually pipelining through transforms using XMLSpy EE 2014 Transform 
Example10.sch with iso_svrl_for_xslt1 - no output to save as .xsl


What is the expected output? What do you see instead?
Expected: standard .xsl to apply to instance
Got:(XMLSpy output window): The XSL Transformation did not create any output.

What version of the product are you using? On what operating system?
<h1>ISO SCHEMATRON 2010</h1>

Please provide any additional information below.
No pre-processing...just apply primary transformer for .sch hoping for .xsl 

Confirm:
Manual pipeline: 
.sch==>iso_dsdl_include.xsl ==>.sch
.sch==>iso_abstract_expand.xsl ==> .sch
.sch-->iso_svr_for_xslt1.xsl ==> .xsl ("Save As")...

Please help...I'd like to get into this

Original issue reported on code.google.com by [email protected] on 3 Dec 2013 at 3:59

Attachments:

possible bug in iso_abstract_expand.xsl

Hello Rick,
I emailed you this bug a while ago, not sure if you got it.

When you have an instance of an abstract pattern (a pattern with
@is-a) that doesn't have @id, the variables are not replaced with the
parameters values. If the pattern has @id then everything works fine.

Here's my code:

<pattern is-a="string-length">
  <param name="el" value="name"/>
  <param name="max-chars" value="20"/>
  <param name="required" value="true()"/>
</pattern>

<pattern id="string-length" abstract="true">
  <title>Validates input length.</title>

  <rule context="$el">
     <let name="len" value="string-length()" />
     <let name="required" value="false()"/>

     <assert test="not($required) or $len > 0">
        You must enter your <name/>.
     </assert>
     <assert test="$len le $max-chars">
        Maximum characters allowed: <value-of select="$max-chars" />
        (current: <value-of select="$len" />).
     </assert>
  </rule>
</pattern>

Original issue reported on code.google.com by maxtoroq on 2 Oct 2010 at 2:15

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.