Re: Re: Compare 2 instance documents

<[email protected]> Sun, 21 Sep 2003 11:38:18 -0400
Newsgroups gmane.text.xml.schematron
Message-ID <[email protected]>
Thanks.  Knowing I'm heading in the right direction is half the battle!  The slideshow also helped to provide some context for some of the other technologies I've run into while researching schematron.  Thanks again...
> 
> From: Rick Jelliffe <[email protected]>
> Date: 2003/09/20 Sat AM 02:26:17 EDT
> To: [email protected]
> CC: [email protected]
> Subject: Re: [Schematron-love-in] Compare 2 instance documents
> 
> Marty wrote:
> 
> > ?Am I going past the intention of schematron if I use 
> > schematron rules to provide the ability of a candidate 
> > instance document to match a target document??
> 
> No.  
> 
> At the Open Publish Asia/Pacific 2003 Conference a few
> months ago, I gave a presentation specifically centering 
> on this point.  The slides (try doing that with PowerPoint:-)
> are at
>     http://www.topologi.com/resources/pdfs/OpenPublish2003.pdf
> 
> To summarize the argument: 
> 
> 1) We can characterize a basic few kinds of distinct dataflows 
> (Use Cases) for how XML is used: 
>  - transformation
>  - read/write
>  - pipelines
> 
> 2) Each of these different kinds of data flows have different 
> requirements.
> 
> 3) We can therefore match the requirements against the capabilities
> of different schema languages to see which is best-ish. 
> 
> ....
> n) Therefore Schematron is the current best for transformations, 
> WXS is the current best for pipelines, and RELAX NG is the current
> best for read/write.  (Not to say that there are not other factors
> at play too.)
> 
> Cheers
> Rick Jelliffe
> 
> >Hi,
> >
> >I?ll provide some background, but my general question is; ?Am I going past the intention of schematron if I use schematron rules to provide the ability of a candidate instance document to match a target document??
> >
> >For example, I borrowed from the Schematron tutorial (thanks by the way) to create the following sample candidate.xml and target.xml, if I use the rules.sch file against the target the ?incoming candidate? data for address/csz/city doesn?t match.  That?s cool.  Next I?ll add some extension functions to my XSL processor to do Soundex or Metaphone.  I could then use these functions for a different type of match (good so far?)
> >
> >If it isn?t obvious by now, I?m new to Schematron, but if I work this correctly into my XSD I can define ?match rules? to any level of my target schema.  Does this make sense or am I trying to force an unnatural act on Schematron?
> >
> >Has anyone else done anything like this?
> >
> >Thanks for any feedback?
> >
> >Marty
> >
> >Sample matcher:
> >
> >-----------------
> >candidate.xml
> ><address>
> >  <addr1>
> >    <streetnumber>1234</streetnumber>
> >    <streetname>Main</streetname>
> >    <streetsuffix>Street</streetsuffix>
> >  </addr1>
> >  <csz>
> >    <city>Anytownmisspelled</city>
> >    <state>VA</state>
> >    <zip>12345</zip>
> >  </csz>
> ></address>
> >
> >--------------------
> >target.xml
> ><address>
> >  <addr1>
> >    <streetnumber>1234</streetnumber>
> >    <streetname>Main</streetname>
> >    <streetsuffix>Street</streetsuffix>
> >  </addr1>
> >  <csz>
> >    <city>Anytown</city>
> >    <state>VA</state>
> >    <zip>12345</zip>
> >  </csz>
> ></address>
> >
> >----------------------
> >rules.sch
> ><schema xmlns="http://www.ascc.net/xml/schematron">
> >  <title>target matching rules</title>
> >  <phase id="address">
> >    <p>City, State Zip information.</p>
> >    <active pattern="cityPattern" />
> >    <active pattern="statePattern" />
> >    <active pattern="zipPattern" />
> >  </phase>
> >  <pattern id="cityPattern">
> >    <rule context="address/csz/city">
> >      <assert test="document('candidate.xml')/address/csz/city=.">City - not matched.</assert>
> >    </rule>
> >  </pattern>
> >  <pattern id="statePattern">
> >    <rule context="state">
> >      <assert test="string-length(.) &gt; 0">State is required.</assert>
> >    </rule>
> >  </pattern>
> >  <pattern id="zipPattern">
> >    <rule context="zip">
> >      <assert test="string-length(.) &gt; 0">Zip is required.</assert>
> >    </rule>
> >  </pattern>
> ></schema>
> >
> >
> >
> >
> >
> >
> >-------------------------------------------------------
> >This sf.net email is sponsored by:ThinkGeek
> >Welcome to geek heaven.
> >http://thinkgeek.com/sf
> >_______________________________________________
> >Schematron-love-in mailing list
> >[email protected]
> >https://lists.sourceforge.net/lists/listinfo/schematron-love-in
> >  
> >
> 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Schematron-love-in mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/schematron-love-in
> 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf