Here's a first cut at a host config XSD:
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2010, Red Hat Middleware LLC, and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:jboss:host:1.0"
xmlns="urn:jboss:host:1.0"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="1.0">
<xs:element name="host-config" type="host-config"/>
<xs:complexType name="host-config">
<xs:all>
<xs:element name="domain-controller" type="location" minOccurs="1"/>
<xs:element name="servers" type="servers" minOccurs="0"/>
<xs:element name="interfaces" type="interfaces" minOccurs="0"/>
<xs:element name="jvms" type="jvms" minOccurs="0"/>
<xs:element name="extensions" type="extensions" minOccurs="0"/>
</xs:all>
</xs:complexType>
<xs:complexType name="network-configuration">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="server-socket" type="net-conf-server"/>
</xs:choice>
<xs:attribute name="group-size" type="xs:positiveInteger" default="0" use="optional"/>
<xs:attribute name="maximum-offset" type="xs:positiveInteger" default="100" use="optional"/>
</xs:complexType>
<xs:complexType name="location">
<xs:attribute name="location" type="xs:anyURI" use="required"/>
<!-- the interface to bind to for outbound connections to the given location -->
<xs:attribute name="bind-interface" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="servers">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="server" type="server"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="server">
<xs:all>
<!-- this element is present if the server is started at boot; otherwise, the server is configured but idle -->
<xs:element name="running" minOccurs="0"/>
<xs:element name="port-group" type="ref" minOccurs="0"/>
<xs:element name="interfaces" type="interfaces" minOccurs="0"/>
<xs:element name="jvm" type="jvm" minOccurs="0"/>
</xs:all>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="group" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="bounded-memory-size">
<xs:attribute name="size" type="xs:string"/>
<xs:attribute name="max-size" type="xs:string"/>
</xs:complexType>
<xs:complexType name="memory-size">
<xs:attribute name="size" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="interfaces">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="interface" type="interface"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="interface">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="address" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="arguments">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="argument" type="argument"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="jvm-spec">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<!-- Boot class paths? -->
<!-- Default VM arguments? -->
</xs:choice>
<!-- Default depends on platform. Used to pick the right options -->
<xs:attribute name="type" type="xs:string" use="optional"/>
<!-- The value of java.home -->
<xs:attribute name="path" type="xs:string" use="required"/>
<!-- The name of this JVM -->
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="jvm">
<xs:all>
<!-- Xms, Xmx -->
<xs:element name="heap" type="bounded-memory-size" minOccurs="0"/>
<!-- XX:PermSize, XX:MaxPermSize -->
<xs:element name="permgen" type="bounded-memory-size" minOccurs="0"/>
<!-- Xss -->
<xs:element name="stack" type="memory-size" minOccurs="0"/>
<!-- Large pages? -->
<!-- GC tuning settings? -->
<!-- Arch-specific: CPU affinity? -->
<!-- Arch-specific: "nice" settings? -->
<!-- Generic VM arguments -->
<xs:element name="arguments" type="arguments" minOccurs="0"/>
<xs:element name="system-properties" type="properties" minOccurs="0"/>
<xs:element name="environment-properties" type="properties" minOccurs="0"/>
<!-- Boot class paths? -->
</xs:all>
<!-- Default JVM uses java.home and auto-detects type -->
<xs:attribute name="jvm" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="properties">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="property" type="property"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="property">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="argument">
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="ref">
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="net-conf-server">
<xs:all>
<xs:element name="interface" type="ref" minOccurs="0"/>
<xs:element name="extensions" type="extensions" minOccurs="0"/>
</xs:all>
<xs:attribute name="service-name" type="xs:string" use="required"/>
<xs:attribute name="binding-name" type="xs:string" default="default" use="optional"/>
<xs:attribute name="port" type="port-number" use="required"/>
<xs:attribute name="fixed" type="xs:boolean" default="false" use="optional"/>
</xs:complexType>
<xs:simpleType name="port-number">
<xs:restriction base="xs:int">
<xs:minInclusive value="0"/>
<xs:maxExclusive value="65536"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="jvms">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="jvm" type="jvm-spec"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="extensions">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:any/>
</xs:choice>
</xs:complexType>
</xs:schema>
This is pretty rough though. In particular I don't like having a dedicated "extensions" element for plugging in stuff from other schemas; the alternatives to using "xs:all" are to use "xs:choice" and make everything unbounded (with additional runtime validation), or using "xs:sequence" and losing the ability to make order be significant between different element types. Thanks schema!
Also, I think that since this file and domain.xml have many types in common we should be merging this schema with the domain schema and using multiple root elements (one for host, one for domain).