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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Using Oxygen with Schemetron

[ Lists Home | Date Index | Thread Index ]
  • To: Paul Popiel <PaulP@advancedengine.com>
  • Subject: Re: [xml-dev] Using Oxygen with Schemetron
  • From: George Cristian Bina <george@sync.ro>
  • Date: Wed, 01 Jun 2005 10:34:54 +0300
  • Cc: "Xml-Dev (E-mail)" <xml-dev@lists.xml.org>
  • In-reply-to: <B9F4AED7AF54D511BDA600306E07B4600178060F@EXCHANGEPER>
  • References: <B9F4AED7AF54D511BDA600306E07B4600178060F@EXCHANGEPER>
  • User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Hi Paul,

To validate against the Schematron embedded rules you need to use the 
"Validate with" action. This will show a dialog, choose the Schematron 
tab and specify your XSD schema.

You can also use the "Associate schema" action and choose again the 
Schematron tab and specify your XSD schema. If you have also the XML 
Schema associated with the document using the schemaLocation attribute 
for instance then when you invoke the "Validate" action you will get 
*both* the validation against the Schematron rules and the validation 
against your XML Schema.

There is an article on the documentation page that explains how oXygen 
works with Schematron and covers also the cases of embedded rules in XML 
Schema and in Relax NG:
http://www.oxygenxml.com/doc/HowToSchematron.pdf
You may find interesting also the sample files from 
[oXygen]/samples/schematron where [oXygen] if the folder where you have 
oXygen installed.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Paul Popiel wrote:
> Decided to try using oxygen to embed schemtron into my existing XML schema.
> 
> Im having problems however, and im finding the help documentation limited =(
> 
> How can i embed Schemtron into my XML schema (.xsd) file, and validate the
> file.... and likewise validate any .xml file using the schema.
> 
> i tried this, but having problems:
> 
> <?xml version="1.0"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
> xmlns:sc="http://www.ascc.net/xml/schematron";
> elementFormDefault="qualified">
> 	<xs:annotation>
> 		<xs:appinfo>
> 			<sc:title>Schematron validation</sc:title>
> 			<sc:ns prefix="tron"/>
> 		</xs:appinfo>
> 	</xs:annotation>
> 
> ....
> 
> 	<xs:element name="Entry" type="Entry_CT"/>
> 	<xs:complexType name="Entry_CT">
> 		<xs:simpleContent>
> 			<xs:extension base="xs:string">
> 				<xs:attribute name="column" type="xs:int"/>
> 			</xs:extension>
> 		</xs:simpleContent>
> 	</xs:complexType>
> 	<xs:element name="Table2D" type="Table2D_CT">
> 		<xs:annotation>
> 			<xs:appinfo>
> 				<sc:pattern name="CheckRows">
> 					<sc:rule context="tron:Table2D">
> 						<sc:assert
> test="count(tron:Entry) = tron:@num_rows">Incorrect Number of
> Rows</sc:assert>
> 					</sc:rule>
> 				</sc:pattern>
> 			</xs:appinfo>
> 		</xs:annotation>
> 	</xs:element>
> 	<xs:complexType name="Table2D_CT">
> 		<xs:sequence maxOccurs="unbounded">
> 			<xs:element ref="Entry"/>
> 		</xs:sequence>
> 		<xs:attribute name="num_rows" type="xs:int"/>
> 	</xs:complexType>
> 
> 
> 
> oxygen seems not to do any sort of validation on the schematron tags (e.g. i
> can use a <sc:invalidtag> tag and it will validate it even though schematron
> doesnt have that tag/element)
> and it doesnt work with my .xml file, i.e. i deliberatly have less or more
> Entry elements then what num_rows is set to.
> 
> 
> any sort of help would be greatly appreciated. thanks!
> 
> 
> 
> 
> Paul Popiel
> Software Engineer
> 
> Advanced Engine Components Limited
> 14 Energy St, Malaga WA 6090
> Fax: +61 8 9209 6999
> Mob: 0412 657 051
> mailto:paulp@advancedengine.com
> http://www.advancedengine.com
> 
> 
> 
> **********************************************************************
> This email is confidential.  If you are not the intended recipient, 
> you must not copy, distribute, disclose or otherwise use the 
> information contained in it.   If you have received this email in 
> error, please tell us immediately by return email or by contacting 
> us on (+61 8) 9209 6900 and delete the document.  Email may 
> be susceptible to data corruption, interception and unauthorised 
> amendment.  Advanced Engine Components Ltd is not 
> responsible for any changes made to a document other than 
> those made by Advanced Engine Components Ltd, or for the 
> effect of the changes on the document's meaning.
> 
> You must scan this email and any attachments for viruses. 
> Advanced Engine Components Ltd accepts no liability for any 
> loss, damage or consequence, whether caused by our own 
> negligence or not, resulting directly or indirectly from your 
> receipt of this email or the use of any attachments.
> **********************************************************************
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
> 




 

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

Copyright 2001 XML.org. This site is hosted by OASIS