[ISO schematron] "Validation with" function
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 25
- Joined: Fri Mar 20, 2009 5:28 pm
[ISO schematron] "Validation with" function
Hello,
Trying to validate the following xml file
With the following ISO schmatron schema:
through the "Document->Validate->Validate with..." function brings up the following error messages:
Theses rules works perfectly with other applications, or when embedded in a relaxng schema.
Sounds like the functions is not using the proper XSL for transforming the schamtron rules.
Or am I missing a option/feature?
Thanks in advance.
P.S: working example embedded in rng schema
Trying to validate the following xml file
Code: Select all
<production >
<a.revisionconfig status='in-distribution'/>
</production>
Code: Select all
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0">
<start>
<choice>
<element name="production">
<element name="a.revisionconfig">
<attribute name="status"></attribute>
<attribute name="pin"></attribute>
</element>
</element>
</choice>
</start>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" >
<sch:pattern id="is_prodution">
<sch:let name="isFullManualValidation" value="boolean(//production)"/>
</sch:pattern>
<sch:pattern>
<sch:rule context="//a.revisionconfig[$isFullManualValidation] | //a.sourcerevision[$isFullManualValidation]">
<sch:report test="/production/a.revisionconfig/@status = 'in-distribution' and not(@pin)">
<sch:value-of select="name()"/>
<sch:dir> must have @pin when the TM status is "in-distribution".</sch:dir>
</sch:report>
</sch:rule>
</sch:pattern>
</sch:schema>
</grammar>
SystemID: /home/xxxx/Untitled6.sch
Engine name: ISO Schematron
Severity: error
Description: Failed to compile stylesheet. 1 error detected.
SystemID: /home/xxxx/Untitled6.sch
Engine name: ISO Schematron
Severity: warning
Description: The match pattern in xsl:template may not contain references to variables
SystemID: /home/xxxx/Untitled6.sch
Engine name: ISO Schematron
Severity: fatal
Description: Got a fatal error trying to create a transformer from the stylesheet!
SystemID: /home/xxxx/Untitled6.sch
Engine name: ISO Schematron
Severity: error
Description: Failed to compile stylesheet. 1 error detected.
SystemID: /home/xxxx/Untitled6.sch
Engine name: ISO Schematron
Severity: warning
Description: The match pattern in xsl:template may not contain references to variables
Theses rules works perfectly with other applications, or when embedded in a relaxng schema.
Sounds like the functions is not using the proper XSL for transforming the schamtron rules.
Or am I missing a option/feature?
Thanks in advance.
P.S: working example embedded in rng schema
Code: Select all
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0">
<start>
<choice>
<element name="production">
<element name="a.revisionconfig">
<attribute name="status"></attribute>
</element>
</element>
</choice>
</start>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" >
<sch:pattern id="is_prodution">
<sch:let name="isFullManualValidation" value="boolean(//production)"/>
</sch:pattern>
<sch:pattern id="pin">
<sch:rule context="//a.revisionconfig[$isFullManualValidation] | //a.sourcerevision[$isFullManualValidation]">
<sch:report test="/production/a.revisionconfig/@status = 'in-distribution' and not(@pin)">
<sch:value-of select="name()"/>
<sch:dir> must have @pin when the TM status is "in-distribution".</sch:dir>
</sch:report>
</sch:rule>
</sch:pattern>
</sch:schema>
</grammar>
jerome poupard
AMConresearch
164 Daniel St. N., Suite 202
Arnprior, Ontario
K7S 2L3
AMConresearch
164 Daniel St. N., Suite 202
Arnprior, Ontario
K7S 2L3
-
- Posts: 25
- Joined: Fri Mar 20, 2009 5:28 pm
Re: [ISO schematron] "Validation with" function
Error, second code should be the schematron alone:
Code: Select all
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" >
<sch:pattern id="is_prodution">
<sch:let name="isFullManualValidation" value="boolean(//production)"/>
</sch:pattern>
<sch:pattern>
<sch:rule context="//a.revisionconfig[$isFullManualValidation] | //a.sourcerevision[$isFullManualValidation]">
<sch:report test="/production/a.revisionconfig/@status = 'in-distribution' and not(@pin)">
<sch:value-of select="name()"/>
<sch:dir> must have @pin when the TM status is "in-distribution".</sch:dir>
</sch:report>
</sch:rule>
</sch:pattern>
</sch:schema>
jerome poupard
AMConresearch
164 Daniel St. N., Suite 202
Arnprior, Ontario
K7S 2L3
AMConresearch
164 Daniel St. N., Suite 202
Arnprior, Ontario
K7S 2L3
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: [ISO schematron] "Validation with" function
The default queryBinding for ISO Schematron is xslt1, you need to specify xslt2 in order to have your schema work:
In case of embedded ISO Schematron oXygen automatically uses xslt2 for queryBinding because in general there is no Schematron schema element, the embedded rules can be placed directly in the schema as below:
Best Regards,
George
Code: Select all
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<sch:pattern id="is_prodution">
<sch:let name="isFullManualValidation" value="boolean(//production)"/>
</sch:pattern>
<sch:pattern>
<sch:rule context="//a.revisionconfig[$isFullManualValidation] | //a.sourcerevision[$isFullManualValidation]">
<sch:report test="/production/a.revisionconfig/@status = 'in-distribution' and not(@pin)">
<sch:value-of select="name()"/>
<sch:dir> must have @pin when the TM status is "in-distribution".</sch:dir>
</sch:report>
</sch:rule>
</sch:pattern>
</sch:schema>
Code: Select all
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
xmlns="http://relaxng.org/ns/structure/1.0" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<start>
<choice>
<element name="production">
<sch:pattern id="is_prodution">
<sch:let name="isFullManualValidation" value="boolean(//production)"/>
</sch:pattern>
<element name="a.revisionconfig">
<sch:pattern id="pin">
<sch:rule
context="//a.revisionconfig[$isFullManualValidation] | //a.sourcerevision[$isFullManualValidation]">
<sch:report test="/production/a.revisionconfig/@status = 'in-distribution' and not(@pin)">
<sch:value-of select="name()"/>
<sch:dir> must have @pin when the TM status is "in-distribution".</sch:dir>
</sch:report>
</sch:rule>
</sch:pattern>
<attribute name="status"/>
</element>
</element>
</choice>
</start>
</grammar>
George
George Cristian Bina
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service