OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Generating New Knowledge by Deductive Reasoning usingSchematron

 On Mon, 22 Nov 2010 12:34:41 +0000, Stephen Green 
 <stephengreenubl@gmail.com> wrote:
> I tried SVRL where I had the Schematron schema output escaped XML
> (conforming to the Robber.xml markup in Roger's example but escaped)
> in the 'text' of the report.

 There is now a more direct method to help exactly this kind of use: 

 <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron";
 xmlns:xs="http://www.w3.org/2001/XMLSchema"; queryBinding="xslt2">
 	<sch:pattern id="Check-Speeder-For-Relationship-To-Recent-Events">
 		<sch:rule context="driversLicenseNumber">
 			<sch:let name="speeder-driversLicenseNumber" value="."/>
 			<sch:let name="GunLicense"
                                    value="for $i in
 $i/GunLicense[.//Person/driversLicenseNumber eq

 	<sch:report test="($speeder-driversLicenseNumber eq
 $GunLicense//Person/driversLicenseNumber) and
             ($GunLicense/registeredGun/Gun/serial eq
 doc('Robbery.xml')/RobberyEvent/evidence/Gun/serial) and
             (count($GunLicense) eq 1) and
             (count($GunLicense//Person) eq 1)"
        A person is a robber if the drivers license and gun license 
 match, or something.

   <sch:property id="robber-details">
            <Person> <sch:value-of
 select="parent::Person/child::name"/> </Person>


 The properties declaration can be used by multiple reports if 
 necessary, and a report
 can have multiple properties. This allows PSVI-style annotations and 
 dynamic info but also keeps the
 structured information from "polluting" the natural language statements 
 in the reports
 or assertions. The natural language statements are from the POV of the 
 problem stater,
 the <diagnostics> are from the POV of a user, and the <properties> are 
 from the POV
 of the program consuming the Schematron output.

 What would be cool would be if XSLT2's XPath had functions to test 
 whether a variable had been declared or not:
   if variable-exists( evil-genius ) then  $evil-genius/name

 Rick Jelliffe

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS