[Schematron] How do include a schematron file in XSD viainclude/import ?

contact at spycomponents.com contact at spycomponents.com
Fri Oct 24 02:37:36 EDT 2008


Joe,

I see. Sounds like the .NET Schematron implementation is too lazy to check 
if any Schematron rules are hidden in includes/imports to me. I guess this 
is a little bit tricky to solve with the already existing .NET Schematron 
component. You might need to extract the rules yourself from all files and 
pass them manually to the .NET validator. With a SAX handler this shouldn't 
be too hard. But what do you do if you find more then one place where 
Schematron rules are provided? If you just process your own files this is 
not a problem.

I don't think that any XSL approach helps here.

BTW, your application sounds interesting. Had something like this in my mind 
since months now... ;-) Is there a way to take a look at it or is it just 
for internal use?

Regards, Ewa
http://www.xml-tools.com


----- Original Message ----- 
From: "Joe Robe" <joer00 at gmail.com>
To: <contact at spycomponents.com>
Cc: <schematron at eccnet.com>
Sent: Friday, October 24, 2008 12:47 AM
Subject: Re: [Schematron] How do include a schematron file in XSD 
viainclude/import ?


> Ewa,
>
> thanks so much for your reply. I use a NET schematron implementation
> and yes it does work with app info included in the xsd file.
>
> The problem is that I created an application to create schematron
> rules which than auto creates the schematron file. The idea is to have
> than this file included in the xsd like below. If I replace the
> xs:import by the contents of the imported file, the validator
> correctly validates the schematron rules ! Would using xsl work here ?
> I mean creating a variable in the external file and than do a
> xsl:valueof select="$SchematronRules"...
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema targetNamespace="http://www.opentravel.org/OTA/2003/05"
> elementFormDefault="qualified" version="1.005" id="OTA2005B"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns="http://www.opentravel.org/OTA/2003/05">
> <xs:annotation>
> <xs:appinfo>
> <xs:import schemaLocation="OTA_CancelRQ.xsd"/>
> </xs:appinfo>
> </xs:annotation>
> <xs:annotation>
> <xs:documentation xml:lang="en">All Schema files in the OTA
> specification are made available according to the terms defined by the
> OTA License Agreement at
> http://www.opentravel.org/ota_downloads_form.cfm</xs:documentation>
> </xs:annotation>
> <xs:element name="OTA_CancelRQ">
>
> On Thu, Oct 23, 2008 at 4:56 PM,  <contact at spycomponents.com> wrote:
>> Hi Joe!
>>
>> Simply including or importing Schematron rules into a W3C won't work. The
>> schema include and import elements are used to add other W3C schemas. 
>> What
>> tool do you use for this? Some allow to add the Schematron rules as
>> appinfo. If you search a little bit on the internet you will find some
>> examples like here http://www.xfront.com/ExtendingSchemas.html
>>
>> However, I always found that this is not very convenient. For XML
>> ValidatorBuddy (http://xml-tools.com/ValidatorBuddy.htm) you add a
>> Processing Instruction to the XML instance document in order to enable
>> Schematron validation. This way the W3C schema stays untouched. If you 
>> use
>> ValidatorBuddy in XMLSpy you can also assign the Schematron schema 
>> through
>> the Project.
>>
>> Regards, Ewa
>> http://www.xml-tools.com
>>
>>
>> ----- Original Message -----
>> From: Joe Robe
>> To: schematron at eccnet.com
>> Sent: Thursday, October 23, 2008 1:30 PM
>> Subject: [Schematron] How do include a schematron file in XSD
>> viainclude/import ?
>>
>>
>> Hello,
>>
>> I try to include my schematron rules into my XSD file via import/include 
>> but
>> in both cases its just ignored (means the schematron validator only
>> validates the XSD not the schematron rules)!
>>
>> Whats the correct way doing this ?
>>
>> Joe Robe
>>
>>
>> ________________________________
>>
>> _______________________________________________
>> Schematron mailing list
>> Schematron at eccnet.com
>> http://www.eccnet.com/mailman/listinfo/schematron
>>
>
>
>
> -- 
> Kindest regards
>
> Joe Robe
> President
> RobeSoft Inc.
> Phone:+1 954 234 2662
> Fax:+1 813 425-9759
> EMail:JoeRobe at RobeSoft.com
> Skype:joer00
> Yahoo Messenger ONLY(do not send email):joer33304 at yahoo.com
> MSN:Messenger ONLY(do not send email):joer33304 at hotmail.com
> www.RobeSoft.com 




More information about the Schematron mailing list