logo back up home forward   further reading more topics »

XES - Programmers Guide - nodeAssert

for information about XES schema see these pages.

Package and importList

Defines the package that this is in

	<xs:element name="package">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="classDef" type="classDefType"/>
<xs:element name="importList">
<xs:complexType>
<xs:sequence>
<xs:element name="import" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" type="xs:string" form="unqualified"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>

ClassDef and interfaceDec

This defines a class or interface

	<xs:complexType name="classDefType">
<xs:sequence>
<xs:element name="method" type="methodType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="classDef" type="classDefType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="variable" type="variableType"/>
<xs:element name="tags" type="tagList"/>
<xs:element name="meta" type="xs:string"/>
<xs:element name="comment" type="commentType"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="implements" type="xs:string"/>
<xs:attribute name="extends" type="xs:string"/>
<xs:attribute name="public" type="xs:boolean"/>
<xs:attribute name="private" type="xs:boolean"/>
<xs:attribute name="protected" type="xs:boolean"/>
<xs:attribute name="static" type="xs:boolean"/>
<xs:attribute name="abstract" type="xs:boolean"/>
<xs:attribute name="interface" type="xs:boolean"/>
</xs:complexType>

Method and MethodAbs

This defines a method within a class

	<xs:complexType name="methodType">
<xs:sequence>
<xs:element name="parameterList" type="parameterListType"/>
<xs:element name="tags" type="tagList"/>
<xs:element name="meta" type="xs:string"/>
<xs:element name="variable" type="variableType"/>
<xs:element name="call" type="callType"/>
<xs:element name="comment" type="commentType"/>
<xs:element name="if" type="ifType"/>
<xs:element name="loop" type="loopType"/>
<xs:element name="switch" type="switchType"/>
<xs:element name="try" type="tryType"/>
<xs:element name="break" type="breakType"/>
<xs:element name="return" type="returnType"/>
<xs:element name="block" type="blockType"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="public" type="xs:boolean"/>
<xs:attribute name="private" type="xs:boolean"/>
<xs:attribute name="protected" type="xs:boolean"/>
<xs:attribute name="static" type="xs:boolean"/>
<xs:attribute name="abstract" type="xs:boolean"/>
<xs:attribute name="native" type="xs:boolean"/>
<xs:attribute name="synchonised" type="xs:boolean"/>
<xs:attribute name="final" type="xs:boolean"/>
</xs:complexType>
<xs:complexType name="parameterListType">
<xs:sequence>
<xs:element name="comment" type="commentType"/>
<xs:element name="parameter" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="comment" type="commentType"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="tagType" type="xs:string"/>
<xs:attribute name="tagValue" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>

Loop

This can represent for,while or do-while type of loop.

Depending on which of these (on the value of code) depends on the selection of preCondition, postCondition, initialiser and step as follows:

	<xs:complexType name="loopType">
<xs:sequence>
<xs:element name="preCondition" type="booleanExpressionType"/>
<xs:element name="postCondition" type="booleanExpressionType"/>
<xs:element name="initialiser" type="blockType"/>
<xs:element name="step" type="blockType"/>
<xs:element name="block" type="blockType"/>
</xs:sequence>
<xs:attribute name="code" type="loopSubType"/>
</xs:complexType>
<xs:simpleType name="loopSubType">
<xs:restriction base="xs:string">
<xs:enumeration value="for"/>
<xs:enumeration value="do"/>
<xs:enumeration value="while"/>
</xs:restriction>
</xs:simpleType>

Return

Return from method. This occurs in method definition

	<xs:complexType name="returnType">
<xs:sequence>
<xs:element name="variable" type="variableType"/>
<xs:element name="constant" type="constantType"/>
<xs:element name="call" type="callType"/>
<xs:element name="binaryOp" type="binaryOpType"/>
<xs:element name="unaryOp" type="unaryOpType"/>
<xs:element name="comment" type="commentType"/>
</xs:sequence>
</xs:complexType>

Block

Groups statements in the same way that '{' and '}' groups together statements in C or Java

	<xs:complexType name="blockType">
<xs:sequence minOccurs="2" maxOccurs="unbounded">
<xs:element name="assign" type="assignType"/>
<xs:element name="call" type="callType"/>
<xs:element name="comment" type="commentType"/>
<xs:element name="if" type="ifType"/>
<xs:element name="loop" type="loopType"/>
<xs:element name="switch" type="switchType"/>
<xs:element name="try" type="tryType"/>
<xs:element name="break" type="breakType"/>
<xs:element name="return" type="returnType"/>
<xs:element name="block" type="blockType"/>
</xs:sequence>
</xs:complexType>

BinaryOp

Binary Operation contains two elements plus an operation to be performed on them

The operation is represented by a simple type.

This must contain the 2 elements to be combined, the left hand and right hand operands. In addition any number of comments can be added.

	<xs:complexType name="binaryOpType">
<xs:sequence minOccurs="2" maxOccurs="unbounded">
<xs:element name="variable" type="variableType"/>
<xs:element name="array" type="arrayType"/>
<xs:element name="constant" type="constantType"/>
<xs:element name="call" type="callType"/>
<xs:element name="binaryOp" type="binaryOpType"/>
<xs:element name="unaryOp" type="unaryOpType"/>
<xs:element name="comment" type="commentType"/>
</xs:sequence>
<xs:attribute name="operator" type="operatorType"/>
</xs:complexType>
<xs:simpleType name="operatorType">
<xs:restriction base="xs:string">
<xs:enumeration value="||"/>
<xs:enumeration value="&amp;&amp;"/>
<xs:enumeration value="|"/>
<xs:enumeration value="^"/>
<xs:enumeration value="&amp;"/>
<xs:enumeration value="=="/>
<xs:enumeration value="!="/>
<xs:enumeration value="&lt;"/>
<xs:enumeration value="&gt;"/>
<xs:enumeration value="&lt;="/>
<xs:enumeration value="&gt;="/>
<xs:enumeration value="&lt;&lt;"/>
<xs:enumeration value="&gt;&gt;"/>
<xs:enumeration value="&gt;&gt;&gt;"/>
<xs:enumeration value="+"/>
<xs:enumeration value="-"/>
<xs:enumeration value="*"/>
<xs:enumeration value="/"/>
<xs:enumeration value="%"/>
</xs:restriction>
</xs:simpleType>

Constant

Holds a constant string, integer, floating point or boolean value

	<xs:complexType name="constantType">
<xs:attribute name="intConst" type="xs:int"/>
<xs:attribute name="stringValue" type="xs:string"/>
<xs:attribute name="floatValue" type="xs:float"/>
<xs:attribute name="doubleValue" type="xs:double"/>
<xs:attribute name="booleanValue" type="xs:boolean"/>
</xs:complexType>

dataType

	<xs:simpleType name="primativeType">
<xs:restriction base="xs:string">
<xs:enumeration value="boolean"/>
<xs:enumeration value="byte"/>
<xs:enumeration value="char"/>
<xs:enumeration value="double"/>
<xs:enumeration value="float"/>
<xs:enumeration value="short"/>
<xs:enumeration value="int"/>
<xs:enumeration value="long"/>
<xs:enumeration value="void"/>
<xs:enumeration value="String"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="dataType">
<xs:sequence>
<xs:element name="primative" type="primativeType"/>
</xs:sequence>
<xs:attribute name="className" type="xs:string"/>
<xs:attribute name="array" type="xs:boolean"/>
</xs:complexType>

If

Conditional statement

	<xs:complexType name="ifType">
<xs:sequence>
<xs:element name="condition" type="booleanExpressionType"/>
<xs:element name="block" type="blockType"/>
<xs:element name="elseBlock" type="blockType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="booleanExpressionType">
<xs:sequence>
<xs:element name="constant" type="constantType"/>
<xs:element name="call" type="callType"/>
<xs:element name="binaryOp" type="binaryOpType"/>
<xs:element name="unaryOp" type="unaryOpType"/>
<xs:element name="comment" type="commentType"/>
</xs:sequence>
</xs:complexType>

Switch

Call different blocks depending on value of variable.

	<xs:complexType name="switchType">
<xs:sequence>
<xs:element name="variable" type="variableType"/>
<xs:element name="case" type="caseType"/>
<xs:element name="default" type="caseType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="caseType">
<xs:sequence>
<xs:element name="constant" type="constantType"/>
<xs:element name="block" type="blockType"/>
</xs:sequence>
</xs:complexType>

Try

Allows action to be taken on error. Exception defines error to look for, catchBlock is excecuted if found

	<xs:complexType name="tryType">
<xs:sequence>
<xs:element name="block" type="blockType"/>
<xs:element name="catchBlock" type="catchBlockType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="catchBlockType">
<xs:sequence>
<xs:element name="block" type="blockType"/>
<xs:element name="exception" type="xs:string"/>
</xs:sequence>
</xs:complexType>

Break

Use this type to represent both break and continue depending on what type is set to.

	<xs:complexType name="breakType">
<xs:sequence>
<xs:element name="comment" type="commentType"/>
</xs:sequence>
<xs:attribute name="type" type="breakSubType"/>
</xs:complexType>
<xs:simpleType name="breakSubType">
<xs:restriction base="xs:string">
<xs:enumeration value="break"/>
<xs:enumeration value="continue"/>
</xs:restriction>
</xs:simpleType>

Variable

Defines a variable used by the program.

	<xs:complexType name="variableType">
<xs:sequence>
<xs:element name="comment" type="commentType"/>
<xs:element name="assign" type="assignType"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="public" type="xs:boolean"/>
<xs:attribute name="private" type="xs:boolean"/>
<xs:attribute name="protected" type="xs:boolean"/>
<xs:attribute name="static" type="xs:boolean"/>
<xs:attribute name="primative" type="xs:boolean"/>
<xs:attribute name="array" type="xs:boolean"/>
</xs:complexType>

Assign

This represents an operation which sets a variable such as '=','+=',etc.

This must contain 2 elements, the first is the variable to be assigned (left hand side of equation) and the second is an expression to set its value. In addition any number of comments can be added.

	<xs:complexType name="assignType">
<xs:sequence maxOccurs="unbounded">
<xs:element name="variable" type="variableType"/>
<xs:element name="array" type="arrayType"/>
<xs:element name="constant" type="constantType"/>
<xs:element name="call" type="callType"/>
<xs:element name="binaryOp" type="binaryOpType"/>
<xs:element name="unaryOp" type="unaryOpType"/>
<xs:element name="comment" type="commentType"/>
</xs:sequence>
<xs:attribute name="operator" type="assignOperatorType"/>
</xs:complexType> <xs:simpleType name="assignOperatorType">
<xs:restriction base="xs:string">
<xs:enumeration value="="/>
<xs:enumeration value="+="/>
<xs:enumeration value="-="/>
<xs:enumeration value="*="/>
<xs:enumeration value="/="/>
<xs:enumeration value="amp="/>
<xs:enumeration value="|="/>
<xs:enumeration value="^="/>
<xs:enumeration value="%="/>
<xs:enumeration value="left="/>
<xs:enumeration value="&gt;&gt;="/>
<xs:enumeration value="&gt;&gt;&gt;="/>
</xs:restriction>
</xs:simpleType>

UnaryOperation

An operation with one input and one output such as 'not'

	<xs:complexType name="unaryOpType">
<xs:sequence maxOccurs="unbounded">
<xs:element name="variable" type="variableType"/>
<xs:element name="array" type="arrayType"/>
<xs:element name="constant" type="constantType"/>
<xs:element name="call" type="callType"/>
<xs:element name="binaryOp" type="binaryOpType"/>
<xs:element name="unaryOp" type="unaryOpType"/>
<xs:element name="comment" type="commentType"/>
</xs:sequence>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="operator" type="unaryOperatorType"/>
</xs:complexType>
<xs:simpleType name="unaryOperatorType">
<xs:restriction base="xs:string">
<xs:enumeration value="++"/>
<xs:enumeration value="--"/>
<xs:enumeration value="pre++"/>
<xs:enumeration value="pre--"/>
<xs:enumeration value="!"/>
<xs:enumeration value="~"/>
<xs:enumeration value="+"/>
<xs:enumeration value="-"/>
</xs:restriction>
</xs:simpleType>

Call

Represents a method call, if isNew is set then the class is instantiated.

	<xs:complexType name="callType">
<xs:sequence>
<xs:element name="comment" type="commentType"/>
<xs:element name="parameterValueList" type="parameterValueListType"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="isNew" type="xs:boolean"/>
</xs:complexType>
<xs:complexType name="parameterValueListType">
<xs:sequence>
<xs:element name="comment" type="commentType"/>
<xs:element name="parameterValue" type="parameterValueType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="parameterValueType">
<xs:sequence>
<xs:element name="variable" type="variableType"/>
<xs:element name="constant" type="constantType"/>
<xs:element name="call" type="callType"/>
<xs:element name="binaryOp" type="binaryOpType"/>
<xs:element name="unaryOp" type="unaryOpType"/>
<xs:element name="comment" type="commentType"/>
</xs:sequence>
</xs:complexType>

typeOperator

Cast to type

	<xs:complexType name="castType">
   <xs:sequence>
   <xs:element name="dataType" type="dataType"/>
   <xs:element name="variable" type="variableType"/>
   <xs:element name="constant" type="constantType"/>
   <xs:element name="call" type="callType"/>
   <xs:element name="binaryOp" type="binaryOpType"/>
   <xs:element name="unaryOp" type="unaryOpType"/>
   <xs:element name="comment" type="commentType"/>
   </xs:sequence>
   </xs:complexType>

Array

Array

	<xs:complexType name="arrayType">
   <xs:sequence>
   <xs:element name="dataType" type="dataType"/>
   </xs:sequence>
   <xs:attribute name="size" type="xs:int"/>
   </xs:complexType>

Tag

Tag
	<xs:complexType name="tagType">
<xs:sequence>
<xs:element name="tagValue" type="xs:string"/>
</xs:sequence>
<xs:attribute name="tagType" type="xs:string"/>
</xs:complexType>
<xs:complexType name="tagList">
<xs:sequence>
<xs:element name="tag" type="xs:string"/>
</xs:sequence>
</xs:complexType>

Comment

Allows comments to be inserted anywhere in program

<xs:complexType name="commentType" mixed="true">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:any processContents="lax"/>
</xs:sequence>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>

metadata block
see also:

 

Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover Processing XML with Java: A Guide to SAX, DOM, JDOM, JAXP, and TrAX

Other Java books

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to this site, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

cover JBuilder - There is also a free version of Jbuilder at borland website . However its licence conditions are quite restrictive so you may prefer another java IDE.

Can this page be improved?

Please send me any improvements to here. I would appreciate ideas to make the pages more useful including error correction, ideas for new pages, improvements to wording. It helps if you quote the full URL of the page.

 

progam

I am working on a project which uses these principles, if you would like to help me with this you are welcome to join in, here:

for xml encoding: http://sourceforge.net/projects/xes/

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2008 Martin John Baker - All rights reserved - privacy policy.