Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sdef schema: implementation element



The notion of extending the sdef implementation element for other technologies was discussed briefly in another thread and a bit more off-list.

Here's one way to define the extension formally in an XML Schema for sdefs that can handle both 'cocoa' elements as they are currently used plus additional implementations.

The attributes for the example 'carbon' element are not carved in stone -- the general idea being to allow a flexible symbol lookup for Carbon Events and/or a search for an AppleEvent handler and to provide a parameter list for 'get' and 'set' query events. In this example, the 'parameter-types' would be key/value pairs ('----' 'utxt' e.g.).

Note that other languages such as java, ruby, etc. can use a similar notion provided they are willing to do the xml grunt work to parse up the parent chain to get whatever element/attribute relationships they need.

<!-- sdef.xsd -->

<!-- ... -->

<!-- IMPLEMENTATION ELEMENTS -->

<xsd:element name="implementation" abstract="true"/>
<xsd:element name="cocoa" substitutionGroup="implementation">
	<xsd:complexType>
		<xsd:attribute name="name" type="xsd:NMTOKEN"/>
		<xsd:attribute name="class" type="xsd:NMTOKEN"/>
		<xsd:attribute name="key" type="xsd:NMTOKEN"/>
		<xsd:attribute name="method" type="xsd:NMTOKEN"/>
	</xsd:complexType>
</xsd:element>

<xsd:element name="carbon" substitutionGroup="implementation">
	<xsd:complexType>
		<xsd:attribute name="handler" type="xsd:NMTOKEN"/>
		<xsd:attribute name="event-class" type="OSType"/>
		<xsd:attribute name="event-id" type="OSType"/>
		<xsd:attribute name="parameter-types" type="OSTypes"/>
		<xsd:attribute name="result-type" type="OSType"/>
		<xsd:attribute name="description" type="Text"/>
	</xsd:complexType>
</xsd:element>

Much appreciated if you have comments on the above or suggestions for what other languages could use before I file an enhancement bug.

Philip Aker
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-implementors/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.