package XML schema description v0.1

Chris jcore at sdf.lonestar.org
Tue Jul 3 06:00:43 PDT 2001


Hey guys,

I thought you'd get a kick out of this and be able to contribute some ideas, so I'm sending along the beginnings of an XML schema for ALFS package description.  It's not going to be complete until a system schema gets finished, but oh well.  (Heck, I haven't even validated it yet.)

Anyway, the schema is attached, and here's what a package description using it would look like...  (You can see that the build and install elements are the ones that need a ton of work).

<?xml version="1.0"?>
<package xmlns="http://alfs.linuxfromscratch.org/XML/XSD/package0.1">
	<meta>
		<author email="jcore at sdf.lonestar.org">Chris Forno</author>
		<date>2001-07-03</date>
	</meta>
	<brief>
		<name>bogus</name>
		<version>0.1.0</version>
		<date>2001-06-30</date>
		<description>a completely bogus set of programs</description>
		<dependencies>postgresql crypt</dependencies>
		<naturalLanguages>en</naturalLanguages>
		<programLanguages>C tcl tk</programLanguages>
		<locations archiver="tar gzip" size="117326" md5="99108ab5a6007164a910626bbcc5888f">ftp://ftp.bogusoft.com/pub/bogus/bogus-0.1.0.tar.gz ftp://ftp.mirrors.org/pub/bogusoft.com/bogus/bogus-0.1.0.tar.gz http://www.bogusoft.com/httpdownload/bogus-0.1.0.tar.gz</locations>
		<locations archiver="tar bzip2" size="102485">ftp://packages.linuxfromscratch.org/alfs/packages/common-packages/bogus-0.1.0.tar.bz2</locations>
	</brief>
	<build>
		<unpack/>
		<configure targetDir="bogus-build"/>
		<make/>
	</build>
	<install>
		<makeInstall/>
		<bsdInstall mode="0644" file="examples/bogus.conf" destination="/etc"/>
	</install>
</package>

-- 
Chris
-------------- next part --------------
<schema xmlns="http://www.w3.org/2001/XMLSchema"
	      xmlns:alfs="http://alfs.linuxfromscratch.org/XML/XSD/package0.1"
				targetNamespace="http://alfs.linuxfromscratch.org/XML/XSD/package0.1"
				elementFormDefault="qualified"
				attributeFormDefault="unqualified">

<annotation>
	<documentation xml:lang="en">
	Individual package description schema for Automated Linux From Scratch (ALFS)
	Version 0.1
	Written 2001-07-03 by Chris Forno (jcore at sdf.lonestar.org)
	</documentation>
</annotation>

<element name="package" type="alfs:packageType"/>

<simpleType name="locationsType">
	<list itemType="anyURI"/>
</simpleType>

<!-- for now just leave this as a token, but it might be better of if it's restricted with a pattern -->
<simpleType name="fsPath" type="token"/>

<simpleType name="mode">
	<extension base="string">
		<pattern value="[0-7]{4}"/>
	</extension>
</simpleType>

<complexType name="authorType">
	<simpleContent>
		<extension base="normalizedString">
			<attribute name="email" type="token" use="optional"/>
		</extension>
	</simpleContent>
</complexType>

<complexType name="metaType">
	<sequence>
		<element name="author" type="alfs:authorType" maxOccurs="unbounded"/>
		<element name="date" type="date"/>
	</sequence>
</complexType>

<complexType name="briefType">
	<sequence>
		<element name="name" type="Name"/>
		<element name="version" type="token"/>
		<element name="date" type="date"/>
		<element name="description" type="string"/>
		<element name="dependencies">
			<simpleType>
				<list itemType="Name"/>
			</simpleType>
		</element>
		<element name="naturalLanguages">
			<simpleType>
				<list itemType="language"/>
			</simpleType>
		</element>
		<element name="programLanguages">
			<simpleType>
				<list itemType="Name"/>
			</simpleType>
		</element>
		<element name="locations" maxOccurs="unbounded">
			<complexType>
				<simpleContent>
					<extension base="alfs:locationsType">
						<attribute name="archiver" type="token"/>
						<attribute name="size" type="unsignedLong"/>
						<attribute name="md5" type="token" use="optional"/>
					</extension>
				</simpleContent>
			</complexType>
		</element>
	</sequence>
</complexType>

<!-- NOTE: buildType is in an incomplete stage -->
<complexType name="buildType">
	<all>
		<element name="unpack">
			<complexType>
				<attribute name="destination" type="alfs:fsPath" use="optional"/>
			</complexType>
		</element>
		<element name="configure">
			<complexType>
				<attribute name="sourceDir" type="alfs:fsPath" use="optional"/>
				<attribute name="targetDir" type="alfs:fsPath" use="optional"/>
			</complexType>
		</element>
		<element name="make" maxOccurs="unbound">
			<complexType>
				<attribute name="target" type="token" use="optional"/>
			</complexType>
		</element>
	</all>
</complexType>

<!-- NOTE: another incomplete type -->
<complexType name="installType">
	<all>
		<element name="makeInstall"/>
		<element name="bsdInstall">
			<complexType>
				<attribute name="mode" type="mode" use="optional"/>
				<attribute name="file" type="token"/>
				<attribute name="destination" type="alfs:fsPath"/>
			</complexType>
		</element>
	</all>
</complexType>

<complexType name="packageType">
	<sequence>
		<element name="meta" type="alfs:metaType"/>
		<element name="brief" type="alfs:briefType"/>
		<element name="build" type="alfs:buildType"/>
		<element name="install" type="alfs:installType"/>
	</sequence>
</complexType>


More information about the alfs-discuss mailing list