The XML Schema below can be copied and pasted into a new file and used as a template for defining a new activity.
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema targetNamespace="http://ogsadai.org.uk/namespaces/2005/10/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ogsadai.org.uk/namespaces/2005/10/types" xmlns:daitypes="http://ogsadai.org.uk/namespaces/2005/10/types"> <!-- Import general OGSA-DAI types. --> <xsd:include schemaLocation="../../xsd/perform.xsd"/> <!-- Define the type for the activity element. The value of the name attribute should be unique. --> <xsd:complexType name="MyActivityType"> <xsd:complexContent> <xsd:extension base="daitypes:ActivityType"> <xsd:sequence> <!-- Define the input element(s) for the activity. --> <xsd:element name="myInput" minOccurs="1" maxOccurs="1" type="daitypes:ActivityInputType"/> <!-- Define any configuration elements for the activity. --> <xsd:element name="myConfiguration" minOccurs="1" maxOccurs="1" > <xsd:complexType> <xsd:attribute name="myAttribute" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"/> </xsd:simpleType> </xsd:attribute> </xsd:complexType> </xsd:element> <!-- Define the output element(s) for the activity. --> <xsd:element name="myOutput" minOccurs="1" maxOccurs="1" type="daitypes:ActivityOutputType"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <!-- Define the name the activity will take on in the perform documents --> <xsd:element name="myActivity" type="tns:MyActivityType" substitutionGroup="daitypes:activity"/> </xsd:schema>
Note that if you are using a validating XML editor to alter the XML Schema template, it may be convenient to temporarily change the xsd:include element used to import general OGSA-DAI types to specify an absolute path. The schemaLocation attribute can be changed to OGSA-DAI/schema/ogsadai/xsd/perform.xsd. However, this should be changed back to the relative path before installing the activity.
Back: How to Write an Activity | ||
© International Business Machines Corporation, 2002-2006 | © The University of Edinburgh, 2002-2006 |