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

Joe Robe joer00 at gmail.com
Thu Oct 23 18:47:49 EDT 2008


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