[jboss-svn-commits] JBL Code SVN: r12645 - labs/jbossrules/trunk/drools-compiler/src/main/resources/META-INF.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sun Jun 17 18:32:04 EDT 2007
Author: fmeyer
Date: 2007-06-17 18:32:04 -0400 (Sun, 17 Jun 2007)
New Revision: 12645
Added:
labs/jbossrules/trunk/drools-compiler/src/main/resources/META-INF/drools-4.0.xsd
Log:
JBRULES-880 - XSD grammar for xml rules
Added: labs/jbossrules/trunk/drools-compiler/src/main/resources/META-INF/drools-4.0.xsd
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/resources/META-INF/drools-4.0.xsd (rev 0)
+++ labs/jbossrules/trunk/drools-compiler/src/main/resources/META-INF/drools-4.0.xsd 2007-06-17 22:32:04 UTC (rev 12645)
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:drools="http://drools.org/drools-4.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://drools.org/drools-4.0">
+ <xs:element name="package">
+ <xs:complexType>
+ <xs:choice maxOccurs="unbounded" minOccurs="0">
+ <xs:element ref="drools:import"/>
+ <xs:element ref="drools:global"/>
+ <xs:element ref="drools:function"/>
+ <xs:element ref="drools:rule"/>
+ <xs:element ref="drools:query"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rule">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" ref="drools:rule-attribute"/>
+ <xs:element ref="drools:lhs"/>
+ <xs:element ref="drools:rhs"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+<!-- All rules must have unique names -->
+ <xs:key name="ruleName">
+ <xs:selector xpath="drools:rule"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+ </xs:element>
+ <xs:element name="query">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="drools:lhs"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+<!-- All rules must have unique names -->
+ <xs:key name="queryName">
+ <xs:selector xpath="drools:query"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+ </xs:element>
+ <xs:element name="rule-attribute">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="value" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="import">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="global">
+ <xs:complexType>
+ <xs:attribute name="type" type="xs:string" use="required"/>
+ <xs:attribute name="identifier" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="function">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" ref="drools:parameter"/>
+ <xs:element name="body" type="xs:string"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="return-type" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="parameter">
+ <xs:complexType>
+ <xs:attribute name="type" type="xs:string" use="required"/>
+ <xs:attribute name="identifier" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rhs" type="xs:string"/>
+
+ <xs:element name="lhs">
+ <xs:complexType>
+ <xs:choice maxOccurs="unbounded" minOccurs="0">
+ <xs:element ref="drools:and"/>
+ <xs:element ref="drools:or"/>
+ <xs:element ref="drools:not"/>
+ <xs:element ref="drools:exists"/>
+ <xs:element ref="drools:eval"/>
+ <xs:element ref="drools:pattern"/>
+ <xs:element ref="drools:forall"/>
+ <xs:element ref="drools:exists"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="and">
+ <xs:complexType>
+ <xs:choice maxOccurs="unbounded" minOccurs="0">
+ <xs:element ref="drools:or"/>
+ <xs:element ref="drools:not"/>
+ <xs:element ref="drools:exists"/>
+ <xs:element ref="drools:eval"/>
+ <xs:element ref="drools:pattern"/>
+ <xs:element ref="drools:field-binding"/>
+ <xs:element ref="drools:field-constraint"/>
+ <xs:element ref="drools:predicate"/>
+ <xs:element ref="drools:literal-restriction"/>
+ <xs:element ref="drools:variable-restriction"/>
+ <xs:element ref="drools:return-value-restriction"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="or">
+ <xs:complexType>
+ <xs:choice maxOccurs="unbounded" minOccurs="0">
+ <xs:element ref="drools:and"/>
+ <xs:element ref="drools:not"/>
+ <xs:element ref="drools:exists"/>
+ <xs:element ref="drools:eval"/>
+ <xs:element ref="drools:pattern"/>
+ <xs:element ref="drools:field-binding"/>
+ <xs:element ref="drools:field-constraint"/>
+ <xs:element ref="drools:predicate"/>
+ <xs:element ref="drools:literal-restriction"/>
+ <xs:element ref="drools:variable-restriction"/>
+ <xs:element ref="drools:return-value-restriction"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="not">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="drools:pattern"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+
+ <xs:element name="exists">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="drools:pattern"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="forall">
+ <xs:complexType>
+ <xs:choice maxOccurs="unbounded" minOccurs="0">
+ <xs:element ref="drools:pattern"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="collect">
+ <xs:complexType>
+ <xs:choice maxOccurs="unbounded" minOccurs="0">
+ <xs:element ref="drools:pattern"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+<!-- Still working
+ <xs:element name="from">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="source" type="xs:string" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+-->
+
+ <xs:element name="eval" type="xs:string"/>
+
+ <xs:element name="pattern">
+ <xs:complexType>
+ <xs:choice maxOccurs="unbounded" minOccurs="0">
+ <xs:element ref="drools:field-binding"/>
+ <xs:element ref="drools:field-constraint"/>
+ <xs:element ref="drools:predicate"/>
+ <xs:element ref="drools:or"/>
+ <xs:element ref="drools:and"/>
+ <!-- xs:element ref="drools:from"/ -->
+ </xs:choice>
+ <xs:attribute name="field-name" type="xs:string" use="optional"/>
+ <xs:attribute name="identifier" type="xs:string" use="optional"/>
+ <xs:attribute name="object-type" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="field-constraint">
+ <xs:complexType>
+ <xs:choice maxOccurs="unbounded" minOccurs="0">
+ <xs:element ref="drools:literal-restriction"/>
+ <xs:element ref="drools:variable-restriction"/>
+ <xs:element ref="drools:return-value-restriction"/>
+ <xs:element ref="drools:restriction-connective"/>
+ </xs:choice>
+ <xs:attribute name="field-name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="field-binding">
+ <xs:complexType>
+ <xs:attribute name="field-name" type="xs:string" use="required"/>
+ <xs:attribute name="identifier" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+
+ <xs:element name="restriction-connective">
+ <xs:complexType>
+ <xs:attribute name="connective" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="literal-restriction">
+ <xs:complexType>
+ <xs:attribute name="evaluator" type="xs:string" use="required"/>
+ <xs:attribute name="value" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="variable-restriction">
+ <xs:complexType>
+ <xs:attribute name="evaluator" type="xs:string" use="required"/>
+ <xs:attribute name="identifier" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="return-value-restriction">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="evaluator" type="xs:string" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="predicate">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="field-name" type="xs:string" use="required"/>
+ <xs:attribute name="identifier" type="xs:string" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
More information about the jboss-svn-commits
mailing list