7150175 radadrgen should generate rad module man pages
authorStephen Talley <stephen.talley@oracle.com>
Wed, 14 Mar 2012 10:45:15 -0400
changeset 809 8a6fba4105d7
parent 808 2122a04679c0
child 810 9907d0f6f03a
7150175 radadrgen should generate rad module man pages 7150179 radadrgen should validate against original rng schema 7150184 radadrgen's output doesn't conform to docbook schema 7150189 adr schema should support documentation markup for union arms 7150226 radadrgen transforms should be internationalized 7150292 radadrgen -c should take a directory name, like -j 7150294 radadrgen command line usage should be broken into multiple synopses 7150352 radadrgen -o text should be revisited 7106700 radadrgen man page lacks documentation, -N, -m options
.hgignore
usr/src/Makefile
usr/src/Makefile.env
usr/src/Makefile.targ
usr/src/cmd/radcli/Makefile
usr/src/doc/manpage/Makefile
usr/src/doc/manpage/man-rad.xml
usr/src/doc/manpage/man-radadrgen.xml
usr/src/doc/manpage/man-vp.xml
usr/src/doc/manpage/rad.1m.xml
usr/src/doc/manpage/radadrgen.1.xml
usr/src/doc/manpage/vp.1.xml
usr/src/doc/rad-dev/Makefile
usr/src/doc/rad-dev/c-libadr-radadrgen.xml
usr/src/doc/rad-dev/c-manpage.xml
usr/src/java/adr/build.xml
usr/src/java/adr/org/opensolaris/os/adr/APIDiff.java
usr/src/java/adr/org/opensolaris/os/adr/CLI.java
usr/src/java/adr/org/opensolaris/os/adr/Interface.java
usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADR.rng
usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADRGen.java
usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADRdoc.rng
usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADRdoc.xsd
usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADRdocbook.xsl
usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADRrmdoc.xsl
usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADRtext.xsl
usr/src/java/adr/org/opensolaris/os/adr/adrgen/CGenerator.java
usr/src/java/adr/org/opensolaris/os/adr/adrgen/DocGenerator.java
usr/src/java/adr/org/opensolaris/os/adr/adrgen/JGenerator.java
usr/src/java/adr/org/opensolaris/os/adr/adrgen/RadADRGen.java
usr/src/java/adr/org/opensolaris/os/adr/adrgen/adr.xsd
usr/src/java/adr/radadrgen.sh
usr/src/java/adr/xml/rng/radadr-doc.rng
usr/src/java/adr/xml/rng/radadr.rng
usr/src/java/adr/xml/style/locale.xsl
usr/src/java/adr/xml/style/locale/radadr-strings.xml
usr/src/java/adr/xml/style/radadr-docbook-common.xsl
usr/src/java/adr/xml/style/radadr-docbook-man.xsl
usr/src/java/adr/xml/style/radadr-docbook.xsl
usr/src/java/adr/xml/style/radadr-rmdoc.xsl
usr/src/java/build-common.xml
usr/src/java/rad/org/opensolaris/os/rad/Client.java
usr/src/pkg/manifests/system-management-rad-client-rad-java.p5m
usr/src/pkg/manifests/system-management-rad-module-rad-kstat.p5m
usr/src/pkg/manifests/system-management-rad-module-rad-smf.p5m
usr/src/pkg/manifests/system-management-rad-module-rad-zones-bridge.p5m
usr/src/pkg/manifests/system-management-rad.p5m
usr/src/test/java/Makefile
--- a/.hgignore	Wed Mar 14 04:47:00 2012 -0700
+++ b/.hgignore	Wed Mar 14 10:45:15 2012 -0400
@@ -26,9 +26,9 @@
 build_wos/.*
 ^proto.*
 ^packages.*
+^usr/src/cmd/rad/daemon/rad$
 ^usr/src/cmd/rad/mod/proto_rad/protocol_xdr.c$
 ^usr/src/cmd/rad/mod/proto_rad/protocol.h$
-^usr/src/cmd/rad/daemon/rad$
 ^usr/src/cmd/radcli/radcli$
 ^usr/src/cmd/radconsole/radconsole$
 ^usr/src/cmd/radpipe/radpipe$
@@ -36,9 +36,9 @@
 ^usr/src/cmd/setpass/setpass$
 ^usr/src/cmd/test/libadr/name$
 ^usr/src/cmd/zmgr/zmgr$
-^usr/src/doc/manpage/.*\.1m?$
+^usr/src/doc/manpage/.*\.(1m?|3rad)$
+^usr/src/doc/rad-dev/.*-proc.xml$
 ^usr/src/doc/rad-dev/rad-devguide.html$
-^usr/src/doc/rad-dev/.*-proc.xml$
 ^usr/src/java/vpanels/java.policy$
 ^usr/src/java/vpanels/vp$
 ^usr/src/lib.*_jni/.*\.h
--- a/usr/src/Makefile	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/Makefile	Wed Mar 14 10:45:15 2012 -0400
@@ -20,20 +20,20 @@
 #
 
 #
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 include $(SRC)/Makefile.env
 
 java: tools
-cmd lib: java
-cmd: lib
-doc: cmd lib java
+lib: java
+cmd: java lib
+doc: java lib cmd
 
 publish := TARGET = publish
 publish: pkg
 
-test: lib cmd java
+test: java lib cmd
 
 qinstall:
 	$(MAKE) install ANT='ant -Dquick=true'
--- a/usr/src/Makefile.env	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/Makefile.env	Wed Mar 14 10:45:15 2012 -0400
@@ -84,6 +84,7 @@
 CHMOD = /usr/bin/chmod
 CP = /usr/bin/cp
 EGREP = /usr/bin/egrep
+ENV = /usr/bin/env
 FIND = /usr/bin/find
 GREP = /usr/bin/grep
 GTAR = /usr/sfw/bin/gtar
@@ -106,6 +107,7 @@
 XARGS = /usr/bin/xargs
 PYTHON = /usr/bin/python
 TOUCH = /usr/bin/touch
+TRUE = /usr/bin/true
 CTFMERGE = /opt/onbld/bin/$(ISA)/ctfmerge
 CTFCONVERT = /opt/onbld/bin/$(ISA)/ctfconvert
 
@@ -121,8 +123,13 @@
 JAVA = $(JAVA_HOME)/bin/java
 
 # Consumers must depend on java (or java/adr)
-ADRLOC=$(SRC)/java/adr/adr.jar
-RADADRGEN=$(JAVA) -classpath $(ADRLOC) org.opensolaris.os.adr.adrgen.RadADRGen
+ADRDIR=$(SRC)/java/adr
+ADRLOC=$(ADRDIR)/adr.jar
+RADADRGEN = $(ENV) \
+	RADADR_SCHEMA=$(ADRDIR)/xml/rng/radadr.rng \
+	RADADR_XSLDIR=$(ADRDIR)/xml/style \
+	RADADR_JARDIR=$(ADRDIR) \
+	$(ADRDIR)/radadrgen.sh
 
 # Lint
 LINTFLAGS = -s -errtags=yes -errsecurity=core -errwarn=%all
--- a/usr/src/Makefile.targ	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/Makefile.targ	Wed Mar 14 10:45:15 2012 -0400
@@ -91,10 +91,10 @@
 	$(LINT.c) -mnuvxy -o $(LIBNAME) $(LINTSRCS) > $(LINTOUT) 2>&1
 
 api_%.h api_%_impl.c: $(SRC)/apis/%.xml
-	$(RADADRGEN) -crm $(ADROPTS) $<
+	$(RADADRGEN) -c . -rm $(ADROPTS) $<
 
 api_%.h api_%_impl.c: %.xml
-	$(RADADRGEN) -crm $(ADROPTS) $<
+	$(RADADRGEN) -c . -rm $(ADROPTS) $<
 
 .c.o:
 	$(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK)
--- a/usr/src/cmd/radcli/Makefile	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/cmd/radcli/Makefile	Wed Mar 14 10:45:15 2012 -0400
@@ -64,9 +64,9 @@
 $(ADR_SRCS): $(ADRLOC)
 
 api_%.h api_%_impl.c: $(SRC)/apis/%.xml
-	$(RADADRGEN) -c $<
+	$(RADADRGEN) -c . $<
 
 api_%.h api_%_impl.c: %.xml
-	$(RADADRGEN) -c $<
+	$(RADADRGEN) -c . $<
 
 include $(SRC)/Makefile.targ
--- a/usr/src/doc/manpage/Makefile	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/doc/manpage/Makefile	Wed Mar 14 10:45:15 2012 -0400
@@ -25,16 +25,23 @@
 
 include ../Makefile.doc
 
+APISDIR = $(SRC)/apis
+APIS_CMD = (cd $(APISDIR); $(LS) -1 *.xml 2>/dev/null; $(TRUE))
+#APIS = $(APIS_CMD:sh)
+APIS = kstat.xml smf.xml zonesbridge.xml
+
 MANPAGES_1 = radadrgen.1 vp.1
 MANPAGES_1m = rad.1m
-MANPAGES = $(MANPAGES_1) $(MANPAGES_1m)
+MANPAGES_3rad = $(APIS:%.xml=%.3rad)
+MANPAGES = $(MANPAGES_1) $(MANPAGES_1m) $(MANPAGES_3rad)
 CLOBBER_FILES += $(MANPAGES)
 SRCS = \
-	$(MANPAGES_1:%.1=man-%.xml) \
-	$(MANPAGES_1m:%.1m=man-%.xml)
+	$(MANPAGES_1:%=%.xml) \
+	$(MANPAGES_1m:%=%.xml)
 INSTALLED_FILES = \
 	$(MANPAGES_1:%=$(PROTO_MAN)/man1/%) \
-	$(MANPAGES_1m:%=$(PROTO_MAN)/man1m/%)
+	$(MANPAGES_1m:%=$(PROTO_MAN)/man1m/%) \
+	$(MANPAGES_3rad:%=$(PROTO_MAN)/man3rad/%)
 
 all:	$(MANPAGES)
 
@@ -54,15 +61,18 @@
 
 FIX_MAN = -echo '1,$$s/(lq/*(lq/g\n1,$$s/(rq/*(rq\nw' | ed -s $@
 
-%.1: man-%.xml
+$(PROTO_MAN)/man1/% $(PROTO_MAN)/man1m/% $(PROTO_MAN)/man3rad/%: %
+	$(INS.file)
+
+%.1: %.1.xml
 	$(XSLT.man)
 	$(FIX_MAN)
 
-%.1m: man-%.xml
+%.1m: %.1m.xml
 	$(XSLT.man)
 	$(FIX_MAN)
 
-$(PROTO_MAN)/man1/% $(PROTO_MAN)/man1m/%: %
-	$(INS.file)
+%.3rad: $(APISDIR)/%.xml
+	$(RADADRGEN) -N -o man $< > $@
 
 include $(SRC)/Makefile.targ
--- a/usr/src/doc/manpage/man-rad.xml	Wed Mar 14 04:47:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,621 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<!--
-  PDL HEADER START
-
-  Public Documentation License Notice
-
-  The contents of this Documentation are subject to the Public
-  Documentation License Version 1.01 (the "License"); you may only
-  use this Documentation if you comply with the terms of this License.
-  A copy of the License is available at
-  http://www.opensolaris.org/os/community/documentation/license.
-
-  PDL HEADER END
-
-  Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
--->
-
-<refentry id="man.rad">
-    <refentryinfo>
-	<date>July 7, 2011</date>
-	<productname>SunOS</productname>
-	<productnumber>5.11</productnumber>
-    </refentryinfo>
-
-    <refmeta>
-	<refentrytitle>rad</refentrytitle>
-	<manvolnum>1m</manvolnum>
-	<refmiscinfo class="manual">System Administration Commands</refmiscinfo>
-    </refmeta>
-
-    <refnamediv>
-	<refname>rad</refname>
-	<refpurpose>the Remote Administration Daemon</refpurpose>
-    </refnamediv>
-
-    <refsynopsisdiv>
-	<cmdsynopsis>
-	    <command>/usr/lib/rad/rad</command>
-	    <arg choice="opt"><option>-d</option></arg>
-	    <arg choice="opt"><option>-s</option></arg>
-	    <arg choice="opt">
-		<option>-S</option> <replaceable>fmri</replaceable>
-	    </arg>
-	    <arg choice="opt" rep="repeat">
-		<option>-M</option> <replaceable>module</replaceable>
-		<!-- DocBook doesn't render repeating arguments well -->
-		<arg choice="opt">
-		    <option>-M</option> <replaceable>module</replaceable>
-		</arg>
-	    </arg>
-	    <arg choice="opt" rep="repeat">
-		<option>-m</option> <replaceable>moduledir</replaceable>
-		<!-- DocBook doesn't render repeating arguments well -->
-		<arg choice="opt">
-		    <option>-m</option> <replaceable>moduledir</replaceable>
-		</arg>
-	    </arg>
-	    <arg choice="opt" rep="repeat">
-		<option>-t</option> <replaceable>transpec</replaceable>
-		<!-- DocBook doesn't render repeating arguments well -->
-		<arg choice="opt">
-		    <option>-t</option> <replaceable>transpec</replaceable>
-		</arg>
-	    </arg>
-	    <arg choice="opt">
-	    	<option>-e</option> <replaceable>timeout</replaceable>
-	    </arg>
-	</cmdsynopsis>
-    </refsynopsisdiv>
-
-    <refsection><title>Description</title>
-	<para>
-	    rad is a facility that securely exposes programmatic system
-	    administrative and monitoring interfaces to consumers in a
-	    variety of high-level languages.
-	</para>
-	<para>
-	    rad can be used in two ways.  rad can be run as a service,
-	    in which case it authenticates connections using
-	    <citerefentry> <refentrytitle>getpeerucred</refentrytitle>
-	    <manvolnum>3C</manvolnum> </citerefentry> or <citerefentry>
-	    <refentrytitle>pam</refentrytitle>
-	    <manvolnum>3PAM</manvolnum> </citerefentry>.  When used in
-	    this way, APIs consumed are run as the authenticated user.
-	    This mode of operation is provided with both local
-	    consumers looking to isolate execution of their privileged
-	    operations and remote consumers in mind.  rad can also be
-	    run as an unprivileged program, in which case it serves
-	    solely as a bridge between its clients and the
-	    administrative APIs it publishes.  When used in this way,
-	    any APIs consumed will be run with the rights held by the
-	    rad process.
-	</para>
-	<para>
-	    rad is modular.  The APIs published by rad are delivered as
-	    shared objects, as are the protocols it understands and the
-	    transports it can communicate over.  Multiple instances of
-	    rad can run simultaneously, each functioning independently
-	    of the others, providing different services to different
-	    consumers, and listening for different types of connections
-	    on different ports or interfaces.  rad obtains its
-	    configuration from its command-line options, from
-	    <citerefentry> <refentrytitle>smf</refentrytitle>
-	    <manvolnum>5</manvolnum> </citerefentry>, or from a
-	    combination of the two.
-	</para>
-    </refsection>
-
-    <refsection><title>Options</title>
-	<para>
-	    The following options are available for use on the command
-	    line:
-
-	    <variablelist>
-
-	    <varlistentry>
-	    <term><option>-d</option></term>
-	    <listitem><para>
-		    Emit verbose debugging output.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term><option>-e</option> <replaceable>timeout</replaceable></term>
-	    <listitem><para>
-		Specify a connection timeout in seconds. The default
-		value is 180 seconds.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>
-		<option>-m</option> <replaceable>moduledir</replaceable>
-	    </term>
-	    <listitem><para>
-		Add <replaceable>moduledir</replaceable> to the list of
-		directories to scan and load modules from.  The
-		<option>-m</option> option can be used multiple times
-		to add multiple module directories.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>
-		<option>-M</option> <replaceable>module</replaceable>
-	    </term>
-	    <listitem><para>
-		Add <replaceable>module</replaceable> to the list of
-		modules to load.  <replaceable>module</replaceable>
-		should be an absolute pathname or a pathname relative
-		to the current working directory.  Modules loaded with
-		<option>-M</option> take precedence over modules found
-		using <option>-m</option>.  The <option>-M</option>
-		option can be used multiple times to add multiple
-		modules.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term><option>-t</option> <replaceable>transpec</replaceable></term>
-	    <listitem><para>
-		Instantiate a transport specified by transport
-		specification <replaceable>transpec</replaceable>.  A
-		transport specification has the following format:
-		<!-- On one line to eliminate unwanted whitespace in output -->
-		<replaceable>transport</replaceable>[:<replaceable>option</replaceable>[=<replaceable>value</replaceable>][,<replaceable>option2</replaceable>[=<replaceable>value2</replaceable>]]...]
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term><option>-s</option></term>
-	    <listitem><para>
-		Behave as an <citerefentry>
-		<refentrytitle>svc.startd</refentrytitle>
-		<manvolnum>1M</manvolnum></citerefentry> start method.
-		This option has the following effects:
-	    </para><para>
-		If the <option>-S</option> option is not specified, rad
-		will read its configuration from the service identified
-		by <citerefentry><refentrytitle>scf_myname</refentrytitle>
-		<manvolnum>3SCF</manvolnum></citerefentry>.
-	    </para><para>
-		rad will use <citerefentry>
-		<refentrytitle>smf_method</refentrytitle>
-		<manvolnum>5</manvolnum> </citerefentry>-compatible
-		exit statuses.
-	    </para><para>
-		rad will daemonize, returning success only once it is
-		ready to handle requests.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term><option>-S</option> <replaceable>fmri</replaceable></term>
-	    <listitem><para>
-		Read configuration from the SMF service instance
-		specified by <replaceable>fmri</replaceable>.  When the
-		<option>-s</option> option isn't specified, configured
-		transports are <emphasis>not</emphasis> read from the
-		service to avoid endpoint conflicts with a running
-		service.
-	    </para><para>
-		Module directories specified on the command line are
-		searched before module directories configured in SMF,
-		permitting command line configuration to override SMF
-		configuration.
-	    </para></listitem>
-	    </varlistentry>
-
-	    </variablelist>
-	</para>
-    </refsection>
-
-    <refsection><title>SMF Configuration</title>
-	<para>
-	    When rad reads its configuration from <citerefentry>
-	    <refentrytitle>smf</refentrytitle> <manvolnum>5</manvolnum>
-	    </citerefentry>, it reads general configuration from a
-	    property group called <quote>config</quote> of type
-	    <quote>application</quote>, and reads configuration for
-	    each of an arbitrary number of transports from a series of
-	    properties groups of type <quote>xport_XYZ</quote> where
-	    <quote>XYZ</quote> is replaced with the name of the
-	    transport type.  Multiple instances of a particular
-	    transport type can be configured by creating multiple
-	    property groups of the corresponding type.  The names of
-	    the property groups used to configure transports are not
-	    important.
-	</para>
-
-	<para>
-	    The <quote>config</quote> property group contains the
-	    following properties:
-
-	    <variablelist>
-
-	    <varlistentry>
-	    <term>moduledir</term>
-	    <listitem><para>
-		A list of <literal>astring</literal>s.  The directories
-		to scan and load modules from.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>modules</term>
-	    <listitem><para>
-		A list of <literal>astring</literal>s.  The file names
-		of specific modules to load.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>pam_service</term>
-	    <listitem><para>
-		An <literal>astring</literal>.  The <citerefentry>
-		<refentrytitle>pam</refentrytitle>
-		<manvolnum>3PAM</manvolnum> </citerefentry> service
-		name to use when authenticating.  Defaults to
-		<quote>rad</quote>.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>debug</term>
-	    <listitem><para>
-		A <literal>boolean</literal>.  If true, rad will emit
-		verbose debugging output.  Defaults to
-		<quote>false</quote>.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>timeout</term>
-	    <listitem><para>
-		An <literal>integer</literal>.  The maximum time in
-		seconds to wait for an individual response from the
-		client while authenticating.  Defaults to
-		<quote>180</quote>.
-	    </para></listitem>
-	    </varlistentry>
-
-	    </variablelist>
-	</para>
-    </refsection>
-
-    <refsection><title>Transports</title>
-	<para>
-	    Support for different transport types is delivered in
-	    module form.  Modules for the following transports are
-	    supplied with the system: pipes (pipe), TCP sockets (tcp),
-	    TLS sockets (tls), and Unix-domain sockets (unix).  Each
-	    transport type has a unique set of configuration
-	    properties.  The options for an instance of a transport
-	    type are configured either by defining properties in an SMF
-	    property group or by supplying sub-options to a
-	    <option>-t</option> command-line option.
-	</para>
-
-	<para>
-	    The <quote>pipe</quote> transport reads from and writes to
-	    a specific file descriptor, as is needed when a process
-	    wishes to communicate with a child rad process using a
-	    pipe.  The pipe transport has the following options:
-
-	    <variablelist>
-
-	    <varlistentry>
-	    <term>proto</term>
-	    <listitem><para>
-		An <literal>astring</literal>.  The protocol to use
-		with this transport instance.  Defaults to
-		<quote>rad</quote>.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>fd</term>
-	    <listitem><para>
-		An <literal>integer</literal>.  The file descriptor to
-		read from/write to.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>exit</term>
-	    <listitem><para>
-		A <literal>boolean</literal>.  If true, rad will exit
-		when communication over the pipe ends.  Defaults to
-		<quote>false</quote>.
-	    </para></listitem>
-	    </varlistentry>
-
-	    </variablelist>
-	</para>
-
-	<para>
-	    The <quote>tcp</quote> transport listens for clear-text
-	    connections on a TCP socket.  The tcp transport has the
-	    following options:
-
-	    <variablelist>
-
-	    <varlistentry>
-	    <term>proto</term>
-	    <listitem><para>
-		An <literal>astring</literal>.  The protocol to use
-		with this transport instance.  Defaults to
-		<quote>rad</quote>.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>port</term>
-	    <listitem><para>
-		An <literal>integer</literal>.  The port to listen on
-		for connections.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>localonly</term>
-	    <listitem><para>
-		A <literal>boolean</literal>.  If true, rad will only
-		listen for connections from the local machine.
-		Defaults to <quote>true</quote>.
-	    </para></listitem>
-	    </varlistentry>
-
-	    </variablelist>
-	</para>
-
-	<para>
-	    The <quote>tls</quote> transport listens for TLS
-	    connections on a TCP socket.  The tcp transport has the
-	    following options:
-
-	    <variablelist>
-
-	    <varlistentry>
-	    <term>proto</term>
-	    <listitem><para>
-		An <literal>astring</literal>.  The protocol to use
-		with this transport instance.  Defaults to
-		<quote>rad</quote>.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>port</term>
-	    <listitem><para>
-		An <literal>integer</literal>.  The port to listen on
-		for connections.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>localonly</term>
-	    <listitem><para>
-		A <literal>boolean</literal>.  If true, rad will only
-		listen for connections from the local machine.
-		Defaults to <quote>true</quote>.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>certificate</term>
-	    <listitem><para>
-		An <literal>astring</literal>.  The location of the
-		PEM-formatted x509 certificate to use.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>privatekey</term>
-	    <listitem><para>
-		An <literal>astring</literal>.  The location of the
-		PEM-formatted private key to use.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>generate</term>
-	    <listitem><para>
-		A <literal>boolean</literal>.  If true,
-		<emphasis>and</emphasis> if the specified certificate
-		and privatekey do not exist, rad will generate a new
-		certificate and private key using <citerefentry>
-		<refentrytitle>openssl</refentrytitle>
-		<manvolnum>1openssl</manvolnum> </citerefentry>.
-		Defaults to <quote>false</quote>.
-	    </para></listitem>
-	    </varlistentry>
-
-	    </variablelist>
-	</para>
-
-	<para>
-	    The <quote>unix</quote> transport listens for connections
-	    on an AF_UNIX socket.  The unix transport has the following
-	    options:
-
-	    <variablelist>
-
-	    <varlistentry>
-	    <term>proto</term>
-	    <listitem><para>
-		An <literal>astring</literal>.  The protocol to use
-		with this transport instance.  Defaults to
-		<quote>rad</quote>.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>path</term>
-	    <listitem><para>
-		An <literal>astring</literal>.  The path to listen on.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>peercred</term>
-	    <listitem><para>
-		A <literal>boolean</literal>.  If true, rad will
-		attempt to automatically authenticate connections using
-		<citerefentry>
-		<refentrytitle>getpeerucred</refentrytitle>
-		<manvolnum>3C</manvolnum> </citerefentry>.  Defaults to
-		<quote>true</quote>.
-	    </para></listitem>
-	    </varlistentry>
-
-	    </variablelist>
-	</para>
-    </refsection>
-
-    <refsection><title>Files</title>
-        <para>
-	    <variablelist>
-	    <varlistentry>
-	    <term>/etc/rad/cert.pem</term>
-	    <listitem><para>
-		The location where the remote rad instance
-		(<uri>svc:/system/rad:remote</uri>) stores its
-		certificate.  This file is readable by all users.
-	    </para></listitem>
-	    </varlistentry>
-	    <varlistentry>
-	    <term>/etc/rad/key.pem</term>
-	    <listitem><para>
-		The location where the remote rad instance
-		(<uri>svc:/system/rad:remote</uri>) stores its private
-		key.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term>/system/volatile/rad/radsocket</term>
-	    <listitem><para>
-		The AF_UNIX socket where the local rad instance
-		(<uri>svc:/system/rad:local</uri>) accepts connections
-		that are implicitly authenticated with <citerefentry>
-		<refentrytitle>getpeerucred</refentrytitle>
-		<manvolnum>3C</manvolnum> </citerefentry>.
-	    </para></listitem>
-	    </varlistentry>
-	    <varlistentry>
-	    <term>/system/volatile/rad/radsocket-unauth</term>
-	    <listitem><para>
-		The AF_UNIX socket where the local rad instance
-		(<uri>svc:/system/rad:local</uri>) accepts connections
-		that must explicitly authenticate using <citerefentry>
-		<refentrytitle>pam</refentrytitle>
-		<manvolnum>3PAM</manvolnum> </citerefentry>.
-	    </para></listitem>
-	    </varlistentry>
-	    </variablelist>
-        </para>
-    </refsection>
-
-    <refsection><title>Attributes</title>
-	<para>
-	    See <citerefentry>
-	    <refentrytitle>attributes</refentrytitle>
-	    <manvolnum>5</manvolnum> </citerefentry> for descriptions
-	    of the following attributes:
-	</para>
-	<informaltable>
-	    <tgroup cols="2">
-	    <thead>
-	    <row>
-	    <entry>ATTRIBUTE TYPE</entry>
-	    <entry>ATTRIBUTE VALUE</entry>
-	    </row>
-	    </thead>
-	    <tbody>
-	    <row>
-	    <entry>Availability</entry>
-	    <entry>system/management/rad</entry>
-	    </row>
-	    <row>
-	    <entry>Interface Stability</entry>
-	    <entry>Private</entry>
-	    </row>
-	    </tbody>
-	    </tgroup>
-	</informaltable>
-    </refsection>
-
-    <refsection><title>See Also</title>
-    <para>
-	<citerefentry>
-	<refentrytitle>attributes</refentrytitle>
-	<manvolnum>5</manvolnum>
-	</citerefentry>,
-	<citerefentry>
-	<refentrytitle>getpeerucred</refentrytitle>
-	<manvolnum>3C</manvolnum>
-	</citerefentry>,
-	<citerefentry>
-	<refentrytitle>openssl</refentrytitle>
-	<manvolnum>1openssl</manvolnum>
-	</citerefentry>.
-	<citerefentry>
-	<refentrytitle>pam</refentrytitle>
-	<manvolnum>3PAM</manvolnum>
-	</citerefentry>,
-	<citerefentry>
-	<refentrytitle>pipe</refentrytitle>
-	<manvolnum>2</manvolnum>
-	</citerefentry>,
-	<citerefentry>
-	<refentrytitle>rad</refentrytitle>
-	<manvolnum>1M</manvolnum>
-	</citerefentry>,
-	<citerefentry>
-	<refentrytitle>scf_myname</refentrytitle>
-	<manvolnum>3SCF</manvolnum>
-	</citerefentry>,
-	<citerefentry>
-	<refentrytitle>smf</refentrytitle>
-	<manvolnum>5</manvolnum>
-	</citerefentry>,
-	<citerefentry>
-	<refentrytitle>smf_method</refentrytitle>
-	<manvolnum>5</manvolnum>
-	</citerefentry>,
-	<citerefentry>
-	<refentrytitle>svc.startd</refentrytitle>
-	<manvolnum>1M</manvolnum>
-	</citerefentry>,
-	<citerefentry>
-	<refentrytitle>vp</refentrytitle>
-	<manvolnum>1</manvolnum>
-	</citerefentry>
-    </para>
-    </refsection>
-
-    <refsection><title>Notes</title>
-	<para>
-	    Two instances of rad are delivered by the system.
-	    <uri>svc:/system/rad:local</uri> listens to AF_UNIX
-	    connections at the paths /system/volatile/rad/radsocket and
-	    /system/volatile/rad/radsocket-unauth, and is enabled by 
-	    default.  The former AF_UNIX socket will automatically 
-	    authenticate the connecting process using <citerefentry>
-	    <refentrytitle>getpeerucred</refentrytitle>
-	    <manvolnum>3C</manvolnum> </citerefentry>, while the latter
-	    requires the connecting process to explicitly
-	    authenticate.  <uri>svc:/system/rad:remote</uri> listens to
-	    TLS connections on the port 12302, requires all clients
-	    to explicitly authenticate, and is disabled by default.
-	</para>
-	<para>
-	    Other system components, including some desktop
-	    administrative user interfaces, rely on the local
-	    instance of rad (<uri>svc:/system/rad:local</uri>).
-	</para>
-    </refsection>
-</refentry>
--- a/usr/src/doc/manpage/man-radadrgen.xml	Wed Mar 14 04:47:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<!--
-	PDL HEADER START
-
-	Public Documentation License Notice
-
-	The contents of this Documentation are subject to the Public
-	Documentation License Version 1.01 (the "License"); you may only
-	use this Documentation if you comply with the terms of this License.
-	A copy of the License is available at
-	http://www.opensolaris.org/os/community/documentation/license.
-
-	PDL HEADER END
-
-	Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
--->
-
-<refentry id="man.radadrgen">
-    <refentryinfo>
-	<date>April 12, 2010</date>
-	<productname>SunOS</productname>
-	<productnumber>5.11</productnumber>
-    </refentryinfo>
-
-    <refmeta>
-	<refentrytitle>radadrgen</refentrytitle>
-	<manvolnum>1</manvolnum>
-	<refmiscinfo class="manual">User Commands</refmiscinfo>
-    </refmeta>
-
-    <refnamediv>
-	<refname>radadrgen</refname>
-	<refpurpose>ADR code generator</refpurpose>
-    </refnamediv>
-
-    <refsynopsisdiv>
-	<cmdsynopsis>
-	    <command>/usr/bin/radadrgen</command>
-	    <arg choice="opt">
-		<option>-c</option>
-		<arg choice="opt">
-		    <option>-r</option>
-		    <arg choice="opt"><option>-s</option></arg>
-		</arg>
-	    </arg>
-	    <arg choice="opt">
-	        <option>-j</option> <replaceable>dir</replaceable>
-		<arg choice="opt"><option>-i</option></arg>
-	    </arg>
-	    <arg choice="opt">
-	    	<option>-d</option> <replaceable>baseline.xml</replaceable>
-	    </arg>
-	    <arg choice="req"><replaceable>spec.xml</replaceable></arg>
-	</cmdsynopsis>
-    </refsynopsisdiv>
-
-    <refsection><title>Description</title>
-	<para>
-	    <command>radadrgen</command> is the <acronym>ADR</acronym>
-	    <acronym>IDL</acronym> processing tool.  Its primary
-	    purpose is to generate <acronym>API</acronym>-specific
-	    language bindings for the <command>rad</command> server and
-	    the various <command>rad</command> client environments.
-	    It can also audit changes to interfaces for consistency 
-	    with their versions.
-	    <!--
-	    It can also generate documentation, and can audit changes
-	    to interfaces for consistency with their versions.
-	    -->
-	</para>
-    </refsection>
-
-    <refsection><title>Options</title>
-	<para>
-	    The following options are available for use on the command
-	    line:
-
-	    <variablelist>
-
-	    <varlistentry>
-	    <term><option>-c</option></term>
-	    <listitem><para>
-		Generate C definitions for the types and APIs defined in
-		the input file.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term><option>-r</option></term>
-	    <listitem><para>
-		Generate C server-side definitions that reference entry
-		points using the prescribed entry-point naming scheme.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term><option>-s</option></term>
-	    <listitem><para>
-		Generate C stubs for entry points referenced by the
-		defintions created by the <option>-r</option> option.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term><option>-j</option> <replaceable>dir</replaceable></term>
-	    <listitem><para>
-		Generate Java interfaces for the types and APIs defined in
-		the input file.  The Java source tree will be created under
-		<replaceable>dir</replaceable>.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term><option>-i</option></term>
-	    <listitem><para>
-		Generate concrete implementation classes for all interfaces
-		generated by the <option>-j</option> option.
-	    </para></listitem>
-	    </varlistentry>
-
-	    <varlistentry>
-	    <term><option>-d</option> 
-		<replaceable>baseline.xml</replaceable></term>
-	    <listitem><para>
-		Compare the interfaces defined by <replaceable>baseline.xml
-		</replaceable> and <replaceable>spec.xml</replaceable> and 
-		verify that the version of the modified interface is consistent 
-		with the differences found.  An error message is displayed if 
-		the versions are inconsistent. 
-	    </para></listitem>
-	    </varlistentry>
-
-	    </variablelist>
-	</para>
-    </refsection>
-
-    <refsection><title>Operands</title>
-	<para>
-	    The following operand must be specified on the command line:
-
-	    <variablelist>
-
-	    <varlistentry>
-	    <term><replaceable>spec.xml</replaceable></term>
-	    <listitem><para>
-		The path to the ADR specification for which type and API
-		definitions must be generated.
-	    </para></listitem>
-	    </varlistentry>
-
-	    </variablelist>
-	</para>
-    </refsection>
-</refentry>
--- a/usr/src/doc/manpage/man-vp.xml	Wed Mar 14 04:47:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<!--
-	PDL HEADER START
-
-	Public Documentation License Notice
-
-	The contents of this Documentation are subject to the Public
-	Documentation License Version 1.01 (the "License"); you may only
-	use this Documentation if you comply with the terms of this License.
-	A copy of the License is available at
-	http://www.opensolaris.org/os/community/documentation/license.
-
-	PDL HEADER END
-
-	Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
--->
-
-<refentry id="man.vp">
-    <refentryinfo>
-	<date>March 24, 2010</date>
-	<productname>SunOS</productname>
-	<productnumber>5.11</productnumber>
-    </refentryinfo>
-
-    <refmeta>
-	<refentrytitle>vp</refentrytitle>
-	<manvolnum>1</manvolnum>
-	<refmiscinfo class="manual">User Commands</refmiscinfo>
-    </refmeta>
-
-    <refnamediv>
-	<refname>vp</refname>
-	<refpurpose>starts a Visual Panels UI</refpurpose>
-    </refnamediv>
-
-    <refsynopsisdiv>
-	<cmdsynopsis>
-	    <command>/usr/bin/vp</command>
-	    <arg choice="opt">
-		<option>-h</option> <replaceable>host</replaceable>
-	    </arg>
-	    <arg choice="opt">
-		<option>-p</option> <replaceable>port</replaceable>
-	    </arg>
-	    <arg choice="opt">
-		<option>-u</option> <replaceable>user</replaceable>
-	    </arg>
-	    <arg choice="opt">
-		<option>-r</option> <replaceable>role</replaceable>
-	    </arg>
-	    <arg choice="opt"><option>-j</option></arg>
-	    <arg choice="plain" rep="repeat">
-		<replaceable>address</replaceable>
-	    </arg>
-	</cmdsynopsis>
-
-	<cmdsynopsis>
-	    <command>/usr/bin/vp</command>
-	    <arg choice="plain"><option>-v</option></arg>
-	</cmdsynopsis>
-
-	<cmdsynopsis>
-	    <command>/usr/bin/vp</command>
-	    <arg choice="plain"><option>-?</option></arg>
-	</cmdsynopsis>
-    </refsynopsisdiv>
-
-    <refsection><title>Description</title>
-    <para>
-	<command>vp</command> starts the Visual Panels UI specified by
-	<replaceable>address</replaceable>.
-    </para>
-    </refsection>
-
-    <refsection><title>Options</title>
-    <para>
-	The following options are supported:
-	<variablelist>
-	<varlistentry>
-	<term><option>-h</option> <replaceable>host</replaceable></term>
-	<listitem><para>
-	    Connect to host <replaceable>host</replaceable>.
-	</para></listitem>
-	</varlistentry>
-
-	<varlistentry>
-	<term><option>-p</option> <replaceable>port</replaceable></term>
-	<listitem><para>
-	    Connect to port <replaceable>port</replaceable>.
-	</para></listitem>
-	</varlistentry>
-
-	<varlistentry>
-	<term><option>-u</option> <replaceable>user</replaceable></term>
-	<listitem><para>
-	    Log in as user <replaceable>user</replaceable>.
-	</para></listitem>
-	</varlistentry>
-
-	<varlistentry>
-	<term><option>-r</option> <replaceable>role</replaceable></term>
-	<listitem><para>
-	    Log in as role <replaceable>role</replaceable>.
-	</para></listitem>
-	</varlistentry>
-
-	<varlistentry>
-	<term><option>-j</option></term>
-	<listitem><para>
-	    Launch the specified panel using a new JVM.  Normally an
-	    existing JVM is used, if available.
-	</para></listitem>
-	</varlistentry>
-
-	<varlistentry>
-	<term><option>-v</option></term>
-	<listitem><para>
-	    Print the version number and exit.
-	</para></listitem>
-	</varlistentry>
-
-	<varlistentry>
-	<term><option>-?</option></term>
-	<listitem><para>
-	    Print the help message and exit.
-	</para></listitem>
-	</varlistentry>
-	</variablelist>
-    </para>
-    </refsection>
-
-    <refsection><title>Operands</title>
-    <para>
-	The following operand is supported:
-	<variablelist>
-	<varlistentry>
-	<term><replaceable>address</replaceable></term>
-	<listitem><para>
-	    The address of the management panel to open.
-	</para></listitem>
-	</varlistentry>
-	</variablelist>
-    </para>
-    </refsection>
-
-    <refsection><title>See Also</title>
-    <para>
-	<citerefentry>
-	<refentrytitle>rad</refentrytitle>
-	<manvolnum>1M</manvolnum>
-	</citerefentry>
-    </para>
-    </refsection>
-</refentry>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/doc/manpage/rad.1m.xml	Wed Mar 14 10:45:15 2012 -0400
@@ -0,0 +1,617 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!--
+  PDL HEADER START
+
+  Public Documentation License Notice
+
+  The contents of this Documentation are subject to the Public
+  Documentation License Version 1.01 (the "License"); you may only
+  use this Documentation if you comply with the terms of this License.
+  A copy of the License is available at
+  http://www.opensolaris.org/os/community/documentation/license.
+
+  PDL HEADER END
+
+  Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+-->
+
+<refentry id="man.rad">
+  <refentryinfo>
+    <productname>SunOS</productname>
+    <productnumber>5.11</productnumber>
+  </refentryinfo>
+
+  <refmeta>
+    <refentrytitle>rad</refentrytitle>
+    <manvolnum>1m</manvolnum>
+    <refmiscinfo class="manual">System Administration Commands</refmiscinfo>
+  </refmeta>
+
+  <refnamediv>
+    <refname>rad</refname>
+    <refpurpose>the Remote Administration Daemon</refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>/usr/lib/rad/rad</command>
+      <arg choice="opt"><option>-d</option></arg>
+      <arg choice="opt"><option>-s</option></arg>
+      <arg choice="opt">
+        <option>-S</option> <replaceable>fmri</replaceable>
+      </arg>
+      <arg choice="opt" rep="repeat">
+        <option>-M</option> <replaceable>module</replaceable>
+        <!-- DocBook doesn't render repeating arguments well -->
+        <arg choice="opt">
+          <option>-M</option> <replaceable>module</replaceable>
+        </arg>
+      </arg>
+      <arg choice="opt" rep="repeat">
+        <option>-m</option> <replaceable>moduledir</replaceable>
+        <!-- DocBook doesn't render repeating arguments well -->
+        <arg choice="opt">
+          <option>-m</option> <replaceable>moduledir</replaceable>
+        </arg>
+      </arg>
+      <arg choice="opt" rep="repeat">
+        <option>-t</option> <replaceable>transpec</replaceable>
+        <!-- DocBook doesn't render repeating arguments well -->
+        <arg choice="opt">
+          <option>-t</option> <replaceable>transpec</replaceable>
+        </arg>
+      </arg>
+      <arg choice="opt">
+        <option>-e</option> <replaceable>timeout</replaceable>
+      </arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+
+  <refsection><title>Description</title>
+    <para>
+      rad is a facility that securely exposes programmatic system
+      administrative and monitoring interfaces to consumers in a
+      variety of high-level languages.
+    </para>
+    <para>
+      rad can be used in two ways.  rad can be run as a service,
+      in which case it authenticates connections using
+      <citerefentry> <refentrytitle>getpeerucred</refentrytitle>
+      <manvolnum>3C</manvolnum> </citerefentry> or <citerefentry>
+      <refentrytitle>pam</refentrytitle>
+      <manvolnum>3PAM</manvolnum> </citerefentry>.  When used in
+      this way, <acronym>API</acronym>s consumed are run as the authenticated
+      user.  This mode of operation is provided with both local consumers
+      looking to isolate execution of their privileged operations and remote
+      consumers in mind.  rad can also be run as an unprivileged program, in
+      which case it serves solely as a bridge between its clients and the
+      administrative <acronym>API</acronym>s it publishes.  When used in this
+      way, any <acronym>API</acronym>s consumed will be run with the rights held
+      by the rad process.
+    </para>
+    <para>
+      rad is modular.  The <acronym>API</acronym>s published by rad are
+      delivered as shared objects, as are the protocols it understands and the
+      transports it can communicate over.  Multiple instances of rad can run
+      simultaneously, each functioning independently of the others, providing
+      different services to different consumers, and listening for different
+      types of connections on different ports or interfaces.  rad obtains its
+      configuration from its command-line options, from <citerefentry>
+      <refentrytitle>smf</refentrytitle> <manvolnum>5</manvolnum>
+      </citerefentry>, or from a combination of the two.
+    </para>
+  </refsection>
+
+  <refsection><title>Options</title>
+    <para>
+      The following options are available for use on the command
+      line:
+
+      <variablelist>
+
+      <varlistentry>
+      <term><option>-d</option></term>
+      <listitem><para>
+          Emit verbose debugging output.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term><option>-e</option> <replaceable>timeout</replaceable></term>
+      <listitem><para>
+        Specify a connection timeout in seconds. The default
+        value is 180 seconds.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>
+        <option>-m</option> <replaceable>moduledir</replaceable>
+      </term>
+      <listitem><para>
+        Add <replaceable>moduledir</replaceable> to the list of
+        directories to scan and load modules from.  The
+        <option>-m</option> option can be used multiple times
+        to add multiple module directories.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>
+        <option>-M</option> <replaceable>module</replaceable>
+      </term>
+      <listitem><para>
+        Add <replaceable>module</replaceable> to the list of
+        modules to load.  <replaceable>module</replaceable>
+        should be an absolute pathname or a pathname relative
+        to the current working directory.  Modules loaded with
+        <option>-M</option> take precedence over modules found
+        using <option>-m</option>.  The <option>-M</option>
+        option can be used multiple times to add multiple
+        modules.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term><option>-t</option> <replaceable>transpec</replaceable></term>
+      <listitem><para>
+        Instantiate a transport specified by transport
+        specification <replaceable>transpec</replaceable>.  A
+        transport specification has the following format:
+        <!-- On one line to eliminate unwanted whitespace in output -->
+        <replaceable>transport</replaceable>[:<replaceable>option</replaceable>[=<replaceable>value</replaceable>][,<replaceable>option2</replaceable>[=<replaceable>value2</replaceable>]]...]
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term><option>-s</option></term>
+      <listitem><para>
+        Behave as an <citerefentry>
+        <refentrytitle>svc.startd</refentrytitle>
+        <manvolnum>1M</manvolnum></citerefentry> start method.
+        This option has the following effects:
+      </para><para>
+        If the <option>-S</option> option is not specified, rad
+        will read its configuration from the service identified
+        by <citerefentry><refentrytitle>scf_myname</refentrytitle>
+        <manvolnum>3SCF</manvolnum></citerefentry>.
+      </para><para>
+        rad will use <citerefentry>
+        <refentrytitle>smf_method</refentrytitle>
+        <manvolnum>5</manvolnum> </citerefentry>-compatible
+        exit statuses.
+      </para><para>
+        rad will daemonize, returning success only once it is
+        ready to handle requests.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term><option>-S</option> <replaceable>fmri</replaceable></term>
+      <listitem><para>
+        Read configuration from the SMF service instance
+        specified by <replaceable>fmri</replaceable>.  When the
+        <option>-s</option> option isn't specified, configured
+        transports are <emphasis>not</emphasis> read from the
+        service to avoid endpoint conflicts with a running
+        service.
+      </para><para>
+        Module directories specified on the command line are
+        searched before module directories configured in SMF,
+        permitting command line configuration to override SMF
+        configuration.
+      </para></listitem>
+      </varlistentry>
+
+      </variablelist>
+    </para>
+  </refsection>
+
+  <refsection><title>SMF Configuration</title>
+    <para>
+      When rad reads its configuration from <citerefentry>
+      <refentrytitle>smf</refentrytitle> <manvolnum>5</manvolnum>
+      </citerefentry>, it reads general configuration from a
+      property group called <quote>config</quote> of type
+      <quote>application</quote>, and reads configuration for
+      each of an arbitrary number of transports from a series of
+      properties groups of type <quote>xport_XYZ</quote> where
+      <quote>XYZ</quote> is replaced with the name of the
+      transport type.  Multiple instances of a particular
+      transport type can be configured by creating multiple
+      property groups of the corresponding type.  The names of
+      the property groups used to configure transports are not
+      important.
+    </para>
+
+    <para>
+      The <quote>config</quote> property group contains the
+      following properties:
+
+      <variablelist>
+
+      <varlistentry>
+      <term>moduledir</term>
+      <listitem><para>
+        A list of <literal>astring</literal>s.  The directories
+        to scan and load modules from.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>modules</term>
+      <listitem><para>
+        A list of <literal>astring</literal>s.  The file names
+        of specific modules to load.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>pam_service</term>
+      <listitem><para>
+        An <literal>astring</literal>.  The <citerefentry>
+        <refentrytitle>pam</refentrytitle>
+        <manvolnum>3PAM</manvolnum> </citerefentry> service
+        name to use when authenticating.  Defaults to
+        <quote>rad</quote>.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>debug</term>
+      <listitem><para>
+        A <literal>boolean</literal>.  If true, rad will emit
+        verbose debugging output.  Defaults to
+        <quote>false</quote>.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>timeout</term>
+      <listitem><para>
+        An <literal>integer</literal>.  The maximum time in
+        seconds to wait for an individual response from the
+        client while authenticating.  Defaults to
+        <quote>180</quote>.
+      </para></listitem>
+      </varlistentry>
+
+      </variablelist>
+    </para>
+  </refsection>
+
+  <refsection><title>Transports</title>
+    <para>
+      Support for different transport types is delivered in
+      module form.  Modules for the following transports are
+      supplied with the system: pipes (pipe), TCP sockets (tcp),
+      TLS sockets (tls), and Unix-domain sockets (unix).  Each
+      transport type has a unique set of configuration
+      properties.  The options for an instance of a transport
+      type are configured either by defining properties in an SMF
+      property group or by supplying sub-options to a
+      <option>-t</option> command-line option.
+    </para>
+
+    <para>
+      The <quote>pipe</quote> transport reads from and writes to
+      a specific file descriptor, as is needed when a process
+      wishes to communicate with a child rad process using a
+      pipe.  The pipe transport has the following options:
+
+      <variablelist>
+
+      <varlistentry>
+      <term>proto</term>
+      <listitem><para>
+        An <literal>astring</literal>.  The protocol to use
+        with this transport instance.  Defaults to
+        <quote>rad</quote>.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>fd</term>
+      <listitem><para>
+        An <literal>integer</literal>.  The file descriptor to
+        read from/write to.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>exit</term>
+      <listitem><para>
+        A <literal>boolean</literal>.  If true, rad will exit
+        when communication over the pipe ends.  Defaults to
+        <quote>false</quote>.
+      </para></listitem>
+      </varlistentry>
+
+      </variablelist>
+    </para>
+
+    <para>
+      The <quote>tcp</quote> transport listens for clear-text
+      connections on a TCP socket.  The tcp transport has the
+      following options:
+
+      <variablelist>
+
+      <varlistentry>
+      <term>proto</term>
+      <listitem><para>
+        An <literal>astring</literal>.  The protocol to use
+        with this transport instance.  Defaults to
+        <quote>rad</quote>.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>port</term>
+      <listitem><para>
+        An <literal>integer</literal>.  The port to listen on
+        for connections.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>localonly</term>
+      <listitem><para>
+        A <literal>boolean</literal>.  If true, rad will only
+        listen for connections from the local machine.
+        Defaults to <quote>true</quote>.
+      </para></listitem>
+      </varlistentry>
+
+      </variablelist>
+    </para>
+
+    <para>
+      The <quote>tls</quote> transport listens for TLS
+      connections on a TCP socket.  The tcp transport has the
+      following options:
+
+      <variablelist>
+
+      <varlistentry>
+      <term>proto</term>
+      <listitem><para>
+        An <literal>astring</literal>.  The protocol to use
+        with this transport instance.  Defaults to
+        <quote>rad</quote>.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>port</term>
+      <listitem><para>
+        An <literal>integer</literal>.  The port to listen on
+        for connections.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>localonly</term>
+      <listitem><para>
+        A <literal>boolean</literal>.  If true, rad will only
+        listen for connections from the local machine.
+        Defaults to <quote>true</quote>.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>certificate</term>
+      <listitem><para>
+        An <literal>astring</literal>.  The location of the
+        PEM-formatted x509 certificate to use.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>privatekey</term>
+      <listitem><para>
+        An <literal>astring</literal>.  The location of the
+        PEM-formatted private key to use.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>generate</term>
+      <listitem><para>
+        A <literal>boolean</literal>.  If true,
+        <emphasis>and</emphasis> if the specified certificate
+        and privatekey do not exist, rad will generate a new
+        certificate and private key using <citerefentry>
+        <refentrytitle>openssl</refentrytitle>
+        <manvolnum>1openssl</manvolnum> </citerefentry>.
+        Defaults to <quote>false</quote>.
+      </para></listitem>
+      </varlistentry>
+
+      </variablelist>
+    </para>
+
+    <para>
+      The <quote>unix</quote> transport listens for connections
+      on an AF_UNIX socket.  The unix transport has the following
+      options:
+
+      <variablelist>
+
+      <varlistentry>
+      <term>proto</term>
+      <listitem><para>
+        An <literal>astring</literal>.  The protocol to use
+        with this transport instance.  Defaults to
+        <quote>rad</quote>.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>path</term>
+      <listitem><para>
+        An <literal>astring</literal>.  The path to listen on.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>peercred</term>
+      <listitem><para>
+        A <literal>boolean</literal>.  If true, rad will
+        attempt to automatically authenticate connections using
+        <citerefentry>
+        <refentrytitle>getpeerucred</refentrytitle>
+        <manvolnum>3C</manvolnum> </citerefentry>.  Defaults to
+        <quote>true</quote>.
+      </para></listitem>
+      </varlistentry>
+
+      </variablelist>
+    </para>
+  </refsection>
+
+  <refsection><title>Files</title>
+    <para>
+      <variablelist>
+      <varlistentry>
+      <term>/etc/rad/cert.pem</term>
+      <listitem><para>
+        The location where the remote rad instance
+        (<uri>svc:/system/rad:remote</uri>) stores its
+        certificate.  This file is readable by all users.
+      </para></listitem>
+      </varlistentry>
+      <varlistentry>
+      <term>/etc/rad/key.pem</term>
+      <listitem><para>
+        The location where the remote rad instance
+        (<uri>svc:/system/rad:remote</uri>) stores its private
+        key.
+      </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+      <term>/system/volatile/rad/radsocket</term>
+      <listitem><para>
+        The AF_UNIX socket where the local rad instance
+        (<uri>svc:/system/rad:local</uri>) accepts connections
+        that are implicitly authenticated with <citerefentry>
+        <refentrytitle>getpeerucred</refentrytitle>
+        <manvolnum>3C</manvolnum> </citerefentry>.
+      </para></listitem>
+      </varlistentry>
+      <varlistentry>
+      <term>/system/volatile/rad/radsocket-unauth</term>
+      <listitem><para>
+        The AF_UNIX socket where the local rad instance
+        (<uri>svc:/system/rad:local</uri>) accepts connections
+        that must explicitly authenticate using <citerefentry>
+        <refentrytitle>pam</refentrytitle>
+        <manvolnum>3PAM</manvolnum> </citerefentry>.
+      </para></listitem>
+      </varlistentry>
+      </variablelist>
+    </para>
+  </refsection>
+
+  <refsection><title>Attributes</title>
+    <para>
+      See <citerefentry>
+      <refentrytitle>attributes</refentrytitle>
+      <manvolnum>5</manvolnum> </citerefentry> for descriptions
+      of the following attributes:
+    </para>
+    <informaltable>
+      <tgroup cols="2">
+      <thead>
+      <row>
+      <entry>ATTRIBUTE TYPE</entry>
+      <entry>ATTRIBUTE VALUE</entry>
+      </row>
+      </thead>
+      <tbody>
+      <row>
+      <entry>Availability</entry>
+      <entry>system/management/rad</entry>
+      </row>
+      <row>
+      <entry>Interface Stability</entry>
+      <entry>Private</entry>
+      </row>
+      </tbody>
+      </tgroup>
+    </informaltable>
+  </refsection>
+
+  <refsection><title>See Also</title>
+  <para>
+    <citerefentry>
+    <refentrytitle>attributes</refentrytitle>
+    <manvolnum>5</manvolnum>
+    </citerefentry>,
+    <citerefentry>
+    <refentrytitle>getpeerucred</refentrytitle>
+    <manvolnum>3C</manvolnum>
+    </citerefentry>,
+    <citerefentry>
+    <refentrytitle>openssl</refentrytitle>
+    <manvolnum>1openssl</manvolnum>
+    </citerefentry>.
+    <citerefentry>
+    <refentrytitle>pam</refentrytitle>
+    <manvolnum>3PAM</manvolnum>
+    </citerefentry>,
+    <citerefentry>
+    <refentrytitle>pipe</refentrytitle>
+    <manvolnum>2</manvolnum>
+    </citerefentry>,
+    <citerefentry>
+    <refentrytitle>rad</refentrytitle>
+    <manvolnum>1M</manvolnum>
+    </citerefentry>,
+    <citerefentry>
+    <refentrytitle>scf_myname</refentrytitle>
+    <manvolnum>3SCF</manvolnum>
+    </citerefentry>,
+    <citerefentry>
+    <refentrytitle>smf</refentrytitle>
+    <manvolnum>5</manvolnum>
+    </citerefentry>,
+    <citerefentry>
+    <refentrytitle>smf_method</refentrytitle>
+    <manvolnum>5</manvolnum>
+    </citerefentry>,
+    <citerefentry>
+    <refentrytitle>svc.startd</refentrytitle>
+    <manvolnum>1M</manvolnum>
+    </citerefentry>,
+    <citerefentry>
+    <refentrytitle>vp</refentrytitle>
+    <manvolnum>1</manvolnum>
+    </citerefentry>
+  </para>
+  </refsection>
+
+  <refsection><title>Notes</title>
+    <para>
+      Two instances of rad are delivered by the system.
+      <uri>svc:/system/rad:local</uri> listens to AF_UNIX
+      connections at the paths /system/volatile/rad/radsocket and
+      /system/volatile/rad/radsocket-unauth, and is enabled by 
+      default.  The former AF_UNIX socket will automatically 
+      authenticate the connecting process using <citerefentry>
+      <refentrytitle>getpeerucred</refentrytitle>
+      <manvolnum>3C</manvolnum> </citerefentry>, while the latter
+      requires the connecting process to explicitly
+      authenticate.  <uri>svc:/system/rad:remote</uri> listens to
+      TLS connections on the port 12302, requires all clients
+      to explicitly authenticate, and is disabled by default.
+    </para>
+    <para>
+      Other system components, including some desktop
+      administrative user interfaces, rely on the local
+      instance of rad (<uri>svc:/system/rad:local</uri>).
+    </para>
+  </refsection>
+</refentry>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/doc/manpage/radadrgen.1.xml	Wed Mar 14 10:45:15 2012 -0400
@@ -0,0 +1,362 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!--
+  PDL HEADER START
+
+  Public Documentation License Notice
+
+  The contents of this Documentation are subject to the Public
+  Documentation License Version 1.01 (the "License"); you may only
+  use this Documentation if you comply with the terms of this License.
+  A copy of the License is available at
+  http://www.opensolaris.org/os/community/documentation/license.
+
+  PDL HEADER END
+
+  Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+-->
+
+<refentry id="man.radadrgen">
+  <refentryinfo>
+    <productname>SunOS</productname>
+    <productnumber>5.11</productnumber>
+  </refentryinfo>
+
+  <refmeta>
+    <refentrytitle>radadrgen</refentrytitle>
+    <manvolnum>1</manvolnum>
+    <refmiscinfo class="manual">User Commands</refmiscinfo>
+  </refmeta>
+
+  <refnamediv>
+    <refname>radadrgen</refname>
+    <refpurpose><acronym>API</acronym> code generator</refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>/usr/bin/radadrgen</command>
+      <arg choice="opt">
+        <option>-N</option>
+      </arg>
+      <arg choice="plain">
+        <replaceable>spec.xml</replaceable>
+      </arg>
+    </cmdsynopsis>
+
+    <cmdsynopsis>
+      <command>/usr/bin/radadrgen</command>
+      <arg choice="opt">
+        <option>-N</option>
+      </arg>
+      <arg choice="plain">
+        <option>-c</option>
+      </arg>
+      <arg choice="plain">
+        <replaceable>dir</replaceable>
+      </arg>
+      <arg choice="opt">
+        <option>-r</option>
+        <arg choice="opt">
+          <option>-m</option>
+        </arg>
+        <arg choice="opt">
+          <option>-s</option>
+        </arg>
+      </arg>
+      <arg choice="plain">
+        <replaceable>spec.xml</replaceable>
+      </arg>
+    </cmdsynopsis>
+
+    <cmdsynopsis>
+      <command>/usr/bin/radadrgen</command>
+      <arg choice="opt">
+        <option>-N</option>
+      </arg>
+      <arg choice="plain">
+        <option>-j</option>
+      </arg>
+      <arg choice="plain">
+        <replaceable>dir</replaceable>
+      </arg>
+      <arg choice="opt">
+        <option>-i</option>
+      </arg>
+      <arg choice="plain">
+        <replaceable>spec.xml</replaceable>
+      </arg>
+    </cmdsynopsis>
+
+    <cmdsynopsis>
+      <command>/usr/bin/radadrgen</command>
+      <arg choice="opt">
+        <option>-N</option>
+      </arg>
+      <arg choice="plain">
+        <option>-o</option>
+      </arg>
+      <group choice="plain">
+        <arg choice="plain">docbook</arg>
+        <arg choice="plain">docbook-man</arg>
+        <arg choice="plain">man</arg>
+        <arg choice="plain">rmdoc</arg>
+      </group>
+      <arg choice="plain">
+        <replaceable>spec.xml</replaceable>
+      </arg>
+    </cmdsynopsis>
+
+    <cmdsynopsis>
+      <command>/usr/bin/radadrgen</command>
+      <arg choice="plain">
+        <option>-d</option>
+      </arg>
+      <arg choice="plain">
+        <replaceable>baseline.xml</replaceable>
+      </arg>
+      <arg choice="plain">
+        <replaceable>spec.xml</replaceable>
+      </arg>
+    </cmdsynopsis>
+
+  </refsynopsisdiv>
+
+  <refsect1>
+    <title>Description</title>
+    <para>
+      <command>radadrgen</command> is the <acronym>ADR</acronym>
+      <acronym>IDL</acronym> processing tool.  Its primary
+      purpose is to generate <acronym>API</acronym>-specific
+      language bindings for the <command>rad</command> server and
+      the various <command>rad</command> client environments.
+      It can also generate documentation, and audit changes
+      to interfaces for consistency with their versions.
+    </para>
+
+    <para>
+      All invocations validate the given <replaceable>spec.xml</replaceable>
+      against the <acronym>ADR</acronym> schema.
+    </para>
+  </refsect1>
+
+  <refsect1>
+    <title>Options</title>
+
+    <para>
+      The following options are available for use on the command line:
+    </para>
+
+    <refsect2>
+      <title/>
+      <variablelist>
+        <title>Common Options</title>
+        <varlistentry>
+          <term>
+            <option>-N</option>
+          </term>
+          <listitem>
+            <para>
+              Don't limit what types can be optional.  This restriction is in
+              place to facilitate mapping to languages where certain types
+              aren't naturally nullable.  This option relaxes this restriction
+              for uses where it is both permissible and advantageous for all
+              types to be optional.
+            </para>
+          </listitem>
+        </varlistentry>
+      </variablelist>
+    </refsect2>
+
+    <refsect2>
+      <title/>
+      <variablelist>
+        <title>C Definition Options</title>
+        <varlistentry>
+          <term>
+            <option>-c</option>
+            <replaceable>dir</replaceable>
+          </term>
+          <listitem>
+            <para>
+              Generate C definitions for the types and <acronym>API</acronym>s
+              defined in the input file.  Files will be created under
+              <replaceable>dir</replaceable>.
+            </para>
+          </listitem>
+        </varlistentry>
+
+        <varlistentry>
+          <term>
+            <option>-r</option>
+          </term>
+          <listitem>
+            <para>
+              Generate C server-side definitions that reference entry
+              points using the prescribed entry-point naming scheme.
+            </para>
+          </listitem>
+        </varlistentry>
+
+        <varlistentry>
+          <term>
+            <option>-m</option>
+          </term>
+          <listitem>
+            <para>
+              Don't generate separate definitions for inherited
+              <acronym>API</acronym>s.  By default, new definitions are
+              generated for inherited <acronym>API</acronym>s, replicating the
+              definitions in the inherited <acronym>API</acronym>.
+            </para>
+          </listitem>
+        </varlistentry>
+
+        <varlistentry>
+          <term>
+            <option>-s</option>
+          </term>
+          <listitem>
+            <para>
+              Generate C stubs for entry points referenced by the
+              defintions created by the <option>-r</option> option.
+            </para>
+          </listitem>
+        </varlistentry>
+      </variablelist>
+    </refsect2>
+
+    <refsect2>
+      <title/>
+      <variablelist>
+        <title>Java Definition Options</title>
+        <varlistentry>
+          <term>
+            <option>-j</option>
+            <replaceable>dir</replaceable>
+          </term>
+          <listitem>
+            <para>
+              Generate Java interfaces for the types and <acronym>API</acronym>s
+              defined in the input file.  The Java source tree will be created
+              under
+              <replaceable>dir</replaceable>.
+            </para>
+          </listitem>
+        </varlistentry>
+
+        <varlistentry>
+          <term>
+            <option>-i</option>
+          </term>
+          <listitem>
+            <para>
+              Generate concrete implementation classes for all interfaces
+              generated by the <option>-j</option> option.
+            </para>
+          </listitem>
+        </varlistentry>
+      </variablelist>
+    </refsect2>
+
+    <refsect2>
+      <title/>
+      <variablelist>
+        <title>Documentation Generation Options</title>
+        <varlistentry>
+          <term>
+            <option>-o</option>
+            <replaceable>format</replaceable>
+          </term>
+          <listitem>
+            <para>
+              Generate documentation, in the given format, for the interface
+              definition in <replaceable>spec.xml</replaceable>.  Documentation
+              can be improved by decorating the various parts of the interface
+              definition with &lt;summary&gt; and &lt;doc&gt; elements.
+            </para>
+            <para>
+              Valid formats:
+            </para>
+            <variablelist>
+              <varlistentry>
+                <term>docbook</term>
+                <listitem>
+                  <para>
+                    standard docbook format
+                  </para>
+                </listitem>
+              </varlistentry>
+              <varlistentry>
+                <term>docbook-man</term>
+                <listitem>
+                  <para>
+                    man page content in docbook format, a precursor to man
+                    format, below
+                  </para>
+                </listitem>
+              </varlistentry>
+              <varlistentry>
+                <term>man</term>
+                <listitem>
+                  <para>
+                    a man page, in [nt]roff format
+                  </para>
+                </listitem>
+              </varlistentry>
+              <varlistentry>
+                <term>rmdoc</term>
+                <listitem>
+                  <para>
+                    <replaceable>spec.xml</replaceable>, with the
+                    &lt;summary&gt; and &lt;doc&gt; elements removed
+                  </para>
+                </listitem>
+              </varlistentry>
+            </variablelist>
+          </listitem>
+        </varlistentry>
+      </variablelist>
+    </refsect2>
+
+    <refsect2>
+      <title/>
+      <variablelist>
+        <title>Interface Comparison Options</title>
+        <varlistentry>
+          <term>
+            <option>-d</option>
+            <replaceable>baseline.xml</replaceable>
+          </term>
+          <listitem>
+            <para>
+              Compare the interfaces defined by
+              <replaceable>baseline.xml</replaceable> and <replaceable>spec.xml
+              </replaceable> and verify that the version of the modified
+              interface is consistent with the differences found.  An error
+              message is displayed if the versions are inconsistent.
+            </para>
+          </listitem>
+        </varlistentry>
+      </variablelist>
+    </refsect2>
+  </refsect1>
+
+  <refsect1><title>Operands</title>
+    <para>
+      The following operand must be specified on the command line:
+
+      <variablelist>
+
+        <varlistentry>
+          <term><replaceable>spec.xml</replaceable></term>
+          <listitem><para>
+            The path to the <acronym>API</acronym> specification for which type
+            and <acronym>API</acronym> definitions must be generated.
+          </para></listitem>
+        </varlistentry>
+
+      </variablelist>
+    </para>
+  </refsect1>
+</refentry>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/doc/manpage/vp.1.xml	Wed Mar 14 10:45:15 2012 -0400
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!--
+  PDL HEADER START
+
+  Public Documentation License Notice
+
+  The contents of this Documentation are subject to the Public
+  Documentation License Version 1.01 (the "License"); you may only
+  use this Documentation if you comply with the terms of this License.
+  A copy of the License is available at
+  http://www.opensolaris.org/os/community/documentation/license.
+
+  PDL HEADER END
+
+  Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+-->
+
+<refentry id="man.vp">
+  <refentryinfo>
+    <productname>SunOS</productname>
+    <productnumber>5.11</productnumber>
+  </refentryinfo>
+
+  <refmeta>
+    <refentrytitle>vp</refentrytitle>
+    <manvolnum>1</manvolnum>
+    <refmiscinfo class="manual">User Commands</refmiscinfo>
+  </refmeta>
+
+  <refnamediv>
+    <refname>vp</refname>
+    <refpurpose>starts a Visual Panels UI</refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>/usr/bin/vp</command>
+      <arg choice="opt">
+        <option>-h</option> <replaceable>host</replaceable>
+      </arg>
+      <arg choice="opt">
+        <option>-p</option> <replaceable>port</replaceable>
+      </arg>
+      <arg choice="opt">
+        <option>-u</option> <replaceable>user</replaceable>
+      </arg>
+      <arg choice="opt">
+        <option>-r</option> <replaceable>role</replaceable>
+      </arg>
+      <arg choice="opt"><option>-j</option></arg>
+      <arg choice="plain" rep="repeat">
+        <replaceable>address</replaceable>
+      </arg>
+    </cmdsynopsis>
+
+    <cmdsynopsis>
+      <command>/usr/bin/vp</command>
+      <arg choice="plain"><option>-v</option></arg>
+    </cmdsynopsis>
+
+    <cmdsynopsis>
+      <command>/usr/bin/vp</command>
+      <arg choice="plain"><option>-?</option></arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+
+  <refsection><title>Description</title>
+  <para>
+    <command>vp</command> starts the Visual Panels UI specified by
+    <replaceable>address</replaceable>.
+  </para>
+  </refsection>
+
+  <refsection><title>Options</title>
+  <para>
+    The following options are supported:
+    <variablelist>
+    <varlistentry>
+    <term><option>-h</option> <replaceable>host</replaceable></term>
+    <listitem><para>
+      Connect to host <replaceable>host</replaceable>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term><option>-p</option> <replaceable>port</replaceable></term>
+    <listitem><para>
+      Connect to port <replaceable>port</replaceable>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term><option>-u</option> <replaceable>user</replaceable></term>
+    <listitem><para>
+      Log in as user <replaceable>user</replaceable>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term><option>-r</option> <replaceable>role</replaceable></term>
+    <listitem><para>
+      Log in as role <replaceable>role</replaceable>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term><option>-j</option></term>
+    <listitem><para>
+      Launch the specified panel using a new JVM.  Normally an
+      existing JVM is used, if available.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term><option>-v</option></term>
+    <listitem><para>
+      Print the version number and exit.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term><option>-?</option></term>
+    <listitem><para>
+      Print the help message and exit.
+    </para></listitem>
+    </varlistentry>
+    </variablelist>
+  </para>
+  </refsection>
+
+  <refsection><title>Operands</title>
+  <para>
+    The following operand is supported:
+    <variablelist>
+    <varlistentry>
+    <term><replaceable>address</replaceable></term>
+    <listitem><para>
+      The address of the management panel to open.
+    </para></listitem>
+    </varlistentry>
+    </variablelist>
+  </para>
+  </refsection>
+
+  <refsection><title>See Also</title>
+  <para>
+    <citerefentry>
+    <refentrytitle>rad</refentrytitle>
+    <manvolnum>1M</manvolnum>
+    </citerefentry>
+  </para>
+  </refsection>
+</refentry>
--- a/usr/src/doc/rad-dev/Makefile	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/doc/rad-dev/Makefile	Wed Mar 14 10:45:15 2012 -0400
@@ -48,7 +48,7 @@
 all: html
 
 examples:
-	$(RADADRGEN) -c example.xml
+	$(RADADRGEN) -c . example.xml
 
 docbook: examples $(PROC)
 
--- a/usr/src/doc/rad-dev/c-libadr-radadrgen.xml	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/doc/rad-dev/c-libadr-radadrgen.xml	Wed Mar 14 10:45:15 2012 -0400
@@ -35,7 +35,7 @@
 
 <example><title>Invoking <command>radadrgen</command></title>
 <programlisting>
-$ radadrgen -c example.xml
+$ radadrgen -c . example.xml
 </programlisting>
 </example>
 
--- a/usr/src/doc/rad-dev/c-manpage.xml	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/doc/rad-dev/c-manpage.xml	Wed Mar 14 10:45:15 2012 -0400
@@ -30,7 +30,7 @@
 
     <title><command>man</command> pages</title>
 
-    <xi:include href="../manpage/man-rad.xml" />
+    <xi:include href="../manpage/rad.1m.xml" />
 
-    <xi:include href="../manpage/man-radadrgen.xml" />
+    <xi:include href="../manpage/radadrgen.1.xml" />
 </chapter>
--- a/usr/src/java/adr/build.xml	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/java/adr/build.xml	Wed Mar 14 10:45:15 2012 -0400
@@ -23,23 +23,47 @@
 -->
 
 <project name="adr" default="jar">
-	<import file="../build-common.xml" />
+  <import file="../build-common.xml" />
+
+  <target name="install" depends="jar">
+    <install.default targetdir="${proto.rad.java}" />
+
+    <copy.remove.cddl
+        file="radadrgen.sh"
+        tofile="${proto.bin}/radadrgen" />
 
-	<target name="install" depends="jar">
-		<install.default targetdir="${proto.rad.java}" />
+    <copy.remove.cddl
+        file="xml/rng/radadr.rng"
+        tofile="${proto.xml}/rng/radadr.rng.1" />
 
-		<copy.remove.cddl
-		    file="radadrgen.sh"
-		    tofile="${proto.bin}/radadrgen" />
+    <copy.remove.cddl
+        file="xml/rng/radadr-doc.rng"
+        tofile="${proto.xml}/rng/radadr-doc.rng" />
+
+    <copy.remove.cddl
+        file="xml/style/radadr-rmdoc.xsl"
+        tofile="${proto.xml}/style/radadr-rmdoc.xsl" />
 
-		<copy.remove.cddl
-		    file="org/opensolaris/os/adr/adrgen/ADR.rng"
-		    tofile="${proto.xml}/rng/adr.rng.1" />
+    <copy.remove.cddl
+        file="xml/style/radadr-docbook.xsl"
+        tofile="${proto.xml}/style/radadr-docbook.xsl" />
+
+    <copy.remove.cddl
+        file="xml/style/radadr-docbook-common.xsl"
+        tofile="${proto.xml}/style/radadr-docbook-common.xsl" />
+
+    <copy.remove.cddl
+        file="xml/style/radadr-docbook-man.xsl"
+        tofile="${proto.xml}/style/radadr-docbook-man.xsl" />
 
-		<copy.remove.cddl
-		    file="org/opensolaris/os/adr/adrgen/ADRdoc.rng"
-		    tofile="${proto.xml}/rng/ADRdoc.rng" />
+    <copy.remove.cddl
+        file="xml/style/locale.xsl"
+        tofile="${proto.xml}/style/locale.xsl" />
 
-		<chmod file="${proto.bin}/radadrgen" perm="0555" />
-	</target>
+    <copy.remove.cddl
+        file="xml/style/locale/radadr-strings.xml"
+        tofile="${proto.xml}/style/locale/radadr-strings.xml" />
+
+    <chmod file="${proto.bin}/radadrgen" perm="0555" />
+  </target>
 </project>
--- a/usr/src/java/adr/org/opensolaris/os/adr/APIDiff.java	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/java/adr/org/opensolaris/os/adr/APIDiff.java	Wed Mar 14 10:45:15 2012 -0400
@@ -20,13 +20,15 @@
  */
 
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
  */
 
 package org.opensolaris.os.adr;
 
-import java.util.Map;
-import java.util.EnumMap;
+import java.io.File;
+import java.util.*;
+import java.util.Map.Entry;
+import org.opensolaris.os.adr.adrgen.*;
 
 public class APIDiff {
     public static int diff(Map<String, API> oldApis, Map<String, API> newApis) {
@@ -116,4 +118,29 @@
 	}
 	return err;
     }
+
+    /**
+     * Performs intrinsic validation of the given spec files, then diffs the two
+     * interfaces.  Note: this method does NOT validate against a schema.
+     *
+     * Usage: java ... <baseline.xml> <spec.xml>
+     */
+    public static void main(String[] args) {
+	CLI cli = new CLI(APIDiff.class);
+	if (args.length != 2) {
+	    cli.die(2, "exactly two spec files must be specified");
+	}
+	ADRGen[] adr = new ADRGen[2];
+	for (int i = 0; i < adr.length; i++) {
+	    File file = new File(args[i]);
+	    try {
+		adr[i] = new ADRGen(file, false);
+	    } catch (ParseException e) {
+		cli.die(1, "error parsing file %s: %s", file,
+		    e.getLocalizedMessage());
+	    }
+	}
+	APIDiff.diff(adr[0].getInterface().getAPIs(),
+	    adr[1].getInterface().getAPIs());
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/java/adr/org/opensolaris/os/adr/CLI.java	Wed Mar 14 10:45:15 2012 -0400
@@ -0,0 +1,144 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+
+package org.opensolaris.os.adr;
+
+import java.util.*;
+
+public class CLI {
+    //
+    // Inner classes
+    //
+
+    public static class Option {
+	private char letter_;
+	private String arg_;
+
+	public Option(char letter, String arg) {
+	    letter_ = letter;
+	    arg_ = arg;
+	}
+
+	public char getLetter() {
+	    return letter_;
+	}
+
+	public String getArg() {
+	    return arg_;
+	}
+    }
+
+    //
+    // Instance data
+    //
+
+    private Class mainClass;
+
+    //
+    // Constructors
+    //
+
+    public CLI(Class mainClass) {
+	this.mainClass = mainClass;
+    }
+
+    //
+    // CLI methods
+    //
+
+    public void die(int exit, String format, Object... args) {
+	if (format != null) {
+	    System.err.printf("%s: ", getProg());
+	    System.err.printf(format, args);
+	    System.err.println();
+	}
+	System.exit(exit);
+    }
+
+    public int getOptions(String[] args, String argspec,
+	Map<Character, Option> opts) {
+
+	Map<Character, Boolean> optspecs = new HashMap<Character, Boolean>();
+
+	/* Parse argspec */
+	int length = argspec.length();
+	for (int i = 0; i < length; i++) {
+	    char l = argspec.charAt(i);
+	    boolean hasargs = i + 1 < length && argspec.charAt(i + 1) == ':';
+	    if (hasargs)
+		i++;
+	    optspecs.put(l, hasargs);
+	}
+
+	/* Parse args */
+	boolean inopt = false;
+	char pending = '\0';
+	int i;
+	for (i = 0; i < args.length; i++) {
+	    if (inopt) {
+		opts.put(pending, new Option(pending, args[i]));
+		inopt = false;
+		continue;
+	    }
+
+	    if (args[i].length() == 0 || args[i].charAt(0) != '-')
+		break;
+
+	    for (int j = 1; j < args[i].length(); j++) {
+		char l = args[i].charAt(j);
+		if (!optspecs.containsKey(l)) {
+		    die(2, "invalid option: \"%c\"", l);
+		}
+
+		if (!optspecs.get(l)) {
+		    opts.put(l, new Option(l, null));
+		    continue;
+		}
+
+		if (j + 1 < args[i].length()) {
+		    opts.put(l, new Option(l, args[i].substring(j + 1)));
+		    break;
+		}
+
+		inopt = true;
+		pending = l;
+	    }
+	}
+
+	if (inopt) {
+	    die(2, "option \"%c\" requires an argument", pending);
+	}
+
+	return i;
+    }
+
+    private String getProg() {
+	String prog = System.getProperty("argv0");
+	if (prog == null) {
+	    prog = "java " + mainClass.getName();
+	}
+	return prog;
+    }
+}
--- a/usr/src/java/adr/org/opensolaris/os/adr/Interface.java	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/java/adr/org/opensolaris/os/adr/Interface.java	Wed Mar 14 10:45:15 2012 -0400
@@ -20,15 +20,12 @@
  */
 
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
  */
 
 package org.opensolaris.os.adr;
 
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
 
 /**
  * Represents an ADR interface, which consists of APIs and the types they
@@ -212,12 +209,12 @@
 
 
     /**
-     * Returns an unmodifiable collection of APIs defined by the interface.
+     * Returns an unmodifiable map of APIs defined by the interface.
      *
-     * @return an unmodifiable collection of APIs
+     * @return an unmodifiable map of APIs
      */
-    public Collection<API> getAPIs() {
-	return Collections.unmodifiableCollection(apis_.values());
+    public Map<String, API> getAPIs() {
+	return Collections.unmodifiableMap(apis_);
     }
 
     /**
--- a/usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADR.rng	Wed Mar 14 04:47:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,386 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
-
- CDDL HEADER START
-
-  The contents of this file are subject to the terms of the
-  Common Development and Distribution License (the "License").
-  You may not use this file except in compliance with the License.
- 
-  You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-  or http://www.opensolaris.org/os/licensing.
-  See the License for the specific language governing permissions
-  and limitations under the License.
- 
-  When distributing Covered Code, include this CDDL HEADER in each
-  file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-  If applicable, add the following below this CDDL HEADER, with the
-  fields enclosed by brackets "[]" replaced with your own identifying
-  information: Portions Copyright [yyyy] [name of copyright owner]
-
- CDDL HEADER END
--->
-
-<!--
-  adr.rng: an Abstract Data Representation
-
-  Should be broken up into two schemas, one for data and one for
-  APIs.
--->
-
-<grammar ns="http://www.opensolaris.org/ns/adr"
-    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
-    xmlns="http://relaxng.org/ns/structure/1.0">
-
-	<include href="ADRdoc.rng" />
-
-	<!--
-	  We support a fixed set of built-in types.
-	-->
-	<define name="basetype">
-		<attribute name="type">
-			<choice>
-				<value>boolean</value>
-				<value>string</value>
-				<value>integer</value>
-				<value>long</value>
-				<value>time</value>
-				<value>name</value>
-				<value>uinteger</value>
-				<value>ulong</value>
-				<value>opaque</value>
-				<value>password</value>
-				<value>float</value>
-				<value>double</value>
-			</choice>
-		</attribute>
-	</define>
-
-	<!--
-	  An item is one of a built-in type, a reference to a defined
-	  type, or a list.  The first two are defined by attributes,
-	  the last by a nested, typed list element.
-	-->
-	<define name="typespec">
-		<choice>
-			<ref name="basetype" />
-			<attribute name="typeref" />
-			<ref name="element_list" />
-		</choice>
-	</define>
-
-	<!--
-	  A variable-length list type.
-	-->
-	<define name="element_list">
-		<element name="list">
-			<ref name="typespec" />
-		</element>
-	</define>
-
-	<!--
-	  Some data is optional, i.e. it may more may not be present.
-	  This only applies to certain types, though constraining which
-	  types is currently beyond the scope of this schema.
-	-->
-	<define name="optdata">
-		<optional>
-			<attribute name="optional">
-				<data type="boolean" />
-			</attribute>
-		</optional>
-	</define>
-
-	<define name="typespec-opt" >
-		<ref name="optdata" />
-		<ref name="typespec" />
-	</define>
-
-	<define name="typespec-arm" >
-		<choice>
-			<attribute name="type">
-				<value>void</value>
-			</attribute>
-			<ref name="typespec-opt" />
-		</choice>
-	</define>
-
-	<!--
-	  Permit a structure type to include another structure type.
-	  This is largely syntactic sugar, though it could be exploited
-	  in target languages that support inheritance relationships.
-	-->
-	<define name="element_include">
-		<element name="include">
-			<attribute name="typeref" />
-		</element>
-	</define>
-
-	<define name="element_field">
-		<element name="field">
-			<attribute name="name" />
-			<ref name="doc-optional" /> 
-			<ref name="typespec-opt" />
-		</element>
-	</define>
-
-	<define name="element_type">
-		<element name="type">
-			<attribute name="name" />
-			<ref name="doc-optional" />
-		<choice>
-			<!--
-			  We require at least one field or include.
-			  All includes must come first, though.
-			  Takes care to avoid UPA rule in XSD.
-			-->
-			<group>
-				<oneOrMore>
-					<ref name="element_include" />
-				</oneOrMore>
-				<zeroOrMore>
-					<ref name="element_field" />
-				</zeroOrMore>
-			</group>
-			<oneOrMore>
-				<ref name="element_field" />
-			</oneOrMore>
-		</choice>
-		</element>
-	</define>
-
-	<define name="element_arm">
-		<element name="arm">
-			<attribute name="value" />
-			<ref name="typespec-arm" />
-		</element>
-	</define>
-
-	<define name="element_defaultarm">
-		<element name="default">
-			<ref name="typespec-arm" />
-		</element>
-	</define>
-
-	<define name="element_union">
-		<element name="union">
-			<attribute name="name" />
-			<ref name="doc-optional" />
-			<choice>
-				<attribute name="type">
-					<value>boolean</value>
-				</attribute>
-				<!-- Must be an enumeration -->
-				<attribute name="typeref" />
-			</choice>
-			<oneOrMore>
-				<ref name="element_arm" />
-			</oneOrMore>
-			<optional>
-				<ref name="element_defaultarm" />
-			</optional>
-		</element>
-	</define>
-
-	<define name="element_value">
-		<element name="value">
-			<attribute name="name" />
-			<optional>
-				<attribute name="value" />
-			</optional>
-			<ref name="doc-optional" />
-		</element>
-	</define>
-
-	<define name="element_fallback">
-		<element name="fallback">
-			<attribute name="name" />
-			<ref name="doc-optional" />
-		</element>
-	</define>
-
-	<define name="element_enum">
-		<element name="enum">
-			<attribute name="name" />
-			<ref name="doc-optional" />
-			<oneOrMore>
-				<ref name="element_value" />
-			</oneOrMore>
-			<optional>
-				<ref name="element_fallback" />
-			</optional>
-		</element>
-	</define>
-
-	<define name="element_pragma">
-		<element name="pragma">
-			<attribute name="domain" />
-			<attribute name="name" />
-			<attribute name="value" />
-		</element>
-	</define>
-
-	<define name="optional_error">
-		<optional>
-			<element name="error">
-				<ref name="optdata" />
-				<optional>
-					<attribute name="typeref" />
-				</optional>
-				<ref name="doc-optional" />
-			</element>
-		</optional>
-	</define>
-
-	<define name="property_error">
-		<element name="error">
-			<ref name="optdata"/>
-			<optional>
-				<attribute name="typeref"/>
-			</optional>
-			<optional>
-				<attribute name="for">
-					<choice>
-						<value>ro</value>
-						<value>rw</value>
-						<value>wo</value>
-					</choice>
-				</attribute>
-			</optional>
-			<ref name="doc-optional" />
-		</element>
-	</define>
-
-	<define name="optional_stability">
-		<optional>
-			<attribute name="stability">
-				<choice>
-			  		<value>committed</value>
-				  	<value>uncommitted</value>
-				  	<value>private</value>
-				</choice>	
-			</attribute>		
-		</optional>		
-	</define>
-
-	<define name="element_property">
-		<element name="property">
-			<attribute name="name" />
-			<ref name="optional_stability" />
-			<attribute name="access">
-				<choice>
-					<value>ro</value>
-					<value>rw</value>
-					<value>wo</value>
-				</choice>
-			</attribute>
-			<ref name="doc-optional" />
-			<ref name="typespec-opt" />
-			<optional>
-				<ref name="property_error"/>
-				<optional>
-					<ref name="property_error"/>
-				</optional>
-			</optional>
-		</element>
-	</define>
-
-	<define name="element_method">
-		<element name="method">
-			<attribute name="name" />
-			<ref name="optional_stability" />
-			<ref name="doc-optional" />
-			<optional>
-				<element name="result">
-					<ref name="doc-optional" />
-					<ref name="typespec-opt" />
-				</element>
-			</optional>
-			<ref name="optional_error" />
-			<zeroOrMore>
-				<element name="argument">
-					<attribute name="name" />
-				    	<ref name="doc-optional" />
-					<ref name="typespec-opt" />
-				</element>
-			</zeroOrMore>
-		</element>
-	</define>
-
-	<define name="element_event">
-		<element name="event">
-			<attribute name="name" />
-			<ref name="optional_stability" />
-			<choice>
-				<ref name="basetype" />
-				<attribute name="typeref" />
-			</choice>
-			<ref name="doc-optional" />
-		</element>
-	</define>
-
-	<define name="element_version">
-		<element name="version">
-			<attribute name="major">
-				<data type="integer" />
-			</attribute>
-			<attribute name="minor">
-				<data type="integer" />
-			</attribute>
-			<!-- micro is specified by implementation -->
-			<attribute name="stability">
-				<choice>
-			  		<value>committed</value>
-				  	<value>uncommitted</value>
-				  	<value>private</value>
-				</choice>	
-			</attribute>
-		</element>
-	</define>
-
-	<define name="element_api">
-		<element name="api">
-			<attribute name="name" />
-			<ref name="doc-optional" />
-			<!-- only 1 version per stability level is permitted -->
-			<zeroOrMore>
-				<ref name="element_version" />
-			</zeroOrMore>
-			<zeroOrMore>
-				<ref name="element_include" />
-			</zeroOrMore>
-			<oneOrMore>
-				<choice>
-					<ref name="element_property" />
-					<ref name="element_method" />
-					<ref name="element_event" />
-				</choice>
-			</oneOrMore>
-		</element>
-	</define>
-
-	<!-- optional documentation -->
-	<define name="doc-optional">
-		<optional>
-			<ref name="documentation" />
-		</optional>
-	</define>
-
-    	<start>
-		<element name="interface">
-			<attribute name="name" />
-			<ref name="doc-optional" />
-			<oneOrMore>
-				<choice>
-					<ref name="element_pragma" />
-					<ref name="element_type" />
-					<ref name="element_enum" />
-					<ref name="element_union" />
-					<ref name="element_api" />
-				</choice>
-			</oneOrMore>
-		</element>
-	</start>
-
-</grammar>
--- a/usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADRGen.java	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADRGen.java	Wed Mar 14 10:45:15 2012 -0400
@@ -27,8 +27,9 @@
 
 import java.io.*;
 import java.util.*;
-import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.*;
 import org.opensolaris.os.adr.*;
+import org.opensolaris.os.adr.CLI.Option;
 import org.opensolaris.os.adr.Type.*;
 import org.w3c.dom.*;
 import org.xml.sax.*;
@@ -114,6 +115,10 @@
 	throw new ParseException("UNKNOWN TYPE: " + type);
     }
 
+    public Interface getInterface() {
+	return iface_;
+    }
+
     private boolean validOptional(Type t) {
 	if (checkNullable_) {
 	    if (t.getSource() == Type.Source.ENUM)
@@ -239,7 +244,7 @@
 	T result = parseRef(e, m);
 	if (result == null)
 	    throw new ParseException("include node requires non-empty typeref");
-    	return result;
+	return result;
     }
 
     private void resolveForward(String name, Type newtype)
@@ -423,7 +428,7 @@
 		arms.add(a);
 		values.add(a);
 	    }
-	} else  {
+	} else	{
 	    throw new ParseException(
 		"Union discriminants must be enumerations or booleans");
 	}
@@ -642,7 +647,7 @@
 	return null;
     }
 
-    public ADRGen(DocumentBuilder builder, File file, boolean checkNullable)
+    public ADRGen(File file, boolean checkNullable)
 	throws ParseException {
 
 	checkNullable_ = checkNullable;
@@ -655,12 +660,52 @@
 	 * Parse file.
 	 */
 	try {
+	    DocumentBuilderFactory factory =
+		DocumentBuilderFactory.newInstance();
+	    factory.setNamespaceAware(true);
+
+	    DocumentBuilder builder = factory.newDocumentBuilder();
+
+	    /*
+	     * Contrary to the javadoc, the default error handler just drives on
+	     */
+	    builder.setErrorHandler(
+		new ErrorHandler() {
+		    @Override
+		    public void warning(SAXParseException exception)
+			throws SAXException {
+			throw exception;
+		    }
+
+		    @Override
+		    public void error(SAXParseException exception)
+			throws SAXException {
+			throw exception;
+		    }
+
+		    @Override
+		    public void fatalError(SAXParseException exception)
+			throws SAXException {
+			throw exception;
+		    }
+		});
+
 	    doc_ = builder.parse(file);
+
+	// Thrown by newDocumentBuilder
+	} catch (ParserConfigurationException ex) {
+	    throw new ParseException(ex.getMessage());
+
+	// Thrown by parse
 	} catch (SAXParseException ex) {
-            throw new ParseException(String.format("line %d: %s",
-                ex.getLineNumber(), ex.getMessage()));
+	    throw new ParseException(String.format("line %d: %s",
+		ex.getLineNumber(), ex.getMessage()));
+
+	// Thrown by parse
 	} catch (SAXException ex) {
 	    throw new ParseException(ex.getMessage());
+
+	// Thrown by parse
 	} catch (IOException ex) {
 	    throw new ParseException(file + ": read error");
 	}
@@ -690,10 +735,39 @@
 	}
 
 	if (!forwardTypes_.isEmpty()) {
-	    System.err.println("Unresolved type references:");
-	    for (String t : forwardTypes_.keySet())
-		System.err.println("\t" + t);
-	    throw new ParseException("Unresolved type references");
+	    StringBuilder builder = new StringBuilder();
+	    for (String t : forwardTypes_.keySet()) {
+		if (builder.length() != 0) {
+		    builder.append(", ");
+		}
+		builder.append(t);
+	    }
+	    builder.insert(0, "unresolved type references:");
+	    throw new ParseException(builder.toString());
+	}
+    }
+
+    /**
+     * Performs intrinsic validation of the given spec file.  Note: this method
+     * does NOT validate against a schema.
+     *
+     * Usage: java ... [-N] <spec.xml>
+     */
+    public static void main(String[] args) {
+	CLI cli = new CLI(ADRGen.class);
+	Map<Character, CLI.Option> opts = new HashMap<Character, CLI.Option>();
+	int operands = cli.getOptions(args, "N", opts);
+	if (operands == args.length) {
+	    cli.die(2, "spec file not specified");
+	}
+
+	File file = new File(args[operands]);
+	boolean check_nullable = opts.get('N') == null;
+	try {
+	    new ADRGen(file, check_nullable);
+	} catch (ParseException e) {
+	    cli.die(1, "error parsing file %s: %s", file,
+		e.getLocalizedMessage());
 	}
     }
 }
--- a/usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADRdoc.rng	Wed Mar 14 04:47:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,206 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-
- CDDL HEADER START
-
-  The contents of this file are subject to the terms of the
-  Common Development and Distribution License (the "License").
-  You may not use this file except in compliance with the License.
- 
-  You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-  or http://www.opensolaris.org/os/licensing.
-  See the License for the specific language governing permissions
-  and limitations under the License.
- 
-  When distributing Covered Code, include this CDDL HEADER in each
-  file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-  If applicable, add the following below this CDDL HEADER, with the
-  fields enclosed by brackets "[]" replaced with your own identifying
-  information: Portions Copyright [yyyy] [name of copyright owner]
-
- CDDL HEADER END
--->
-
-<!--
-  ADRdoc.rng: ADR documentation
--->
-
-<grammar ns="http://www.opensolaris.org/ns/adr"
-    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
-    xmlns="http://relaxng.org/ns/structure/1.0">
-
-	<!-- inline doc elements -->
-	<define name="doc-inline">
-		<choice>
-			<text />
-			<ref name="element-doc-code" />
-			<ref name="element-doc-strong" />
-			<ref name="element-doc-link" />
-			<ref name="element-doc-br" />
-		</choice>
-	</define>
-
-	<!-- block doc elements -->
-	<define name="doc-block">
-		<choice>
-			<ref name="element-doc-heading" />
-			<ref name="element-doc-para" />
-			<ref name="element-doc-list" />
-			<ref name="element-doc-example" />
-		</choice>
-	</define>		
-
-	<!-- (inline) code snippet -->
-	<!-- A nested element-doc-code is not permitted. -->
-	<define name="element-doc-code">
-		<element name="code">
-			<ref name="doc-inline-content" />
-		</element>
-	</define>
-
-	<!-- (inline) strong/emphasis -->
-	<!-- A nested element-doc-strong is not permitted. -->
-	<define name="element-doc-strong">
-		<element name="strong">
-			<ref name="doc-inline-content" />
-		</element>
-	</define>
-
-	<!-- (inline) url -->
-	<!-- A nested element-doc-link is not permitted. -->
-	<define name="element-doc-link">
-		<element name="link">
-			<attribute name="url" />
-			<ref name="doc-inline-content" />
-		</element>
-	</define>
-
-	<!-- (inline) line break -->
-	<define name="element-doc-br">
-		<element name="br">
-			<empty />
-		</element>
-	</define>
-
-	<!-- (block) paragraph -->
-	<define name="element-doc-para">
-		<element name="para">
-			<ref name="doc-inline-content" />
-		</element>
-	</define>
-
-	<!-- (block) heading -->
-	<define name="element-doc-heading">
-		<element name="heading">
-			<ref name="doc-inline-content" />
-		</element>
-	</define>
-
-	<!-- (block) example (code, preformatted) -->
-	<define name="element-doc-example">
-		<element name="example">
-			<optional>
-				<attribute name="caption" />
-			</optional>
-			<text />
-		</element>
-	</define>	
-
-	<!-- (block) list item -->
-	<define name="element-doc-item">
-		<element name="item">
-			<oneOrMore>
-				<choice>
-					<ref name="doc-inline" />
-					<ref name="doc-block" />
-				</choice>
-			</oneOrMore>
-		</element>
-	</define>
-
-	<!-- (block) list (rudimentary - ordered, unordered) -->
-	<!-- default = unordered list -->
-	<define name="element-doc-list">
-		<element name="list">
-			<optional>
-				<attribute name="type">
-					<choice>
-						<value>unordered</value>
-						<value>ordered</value>
-					</choice>
-				</attribute>
-			</optional>
-			<oneOrMore>
-				<ref name="element-doc-item" />
-			</oneOrMore>
-		</element>
-	</define>
-
-
-	<!-- documentation attributes -->
-	<!-- language -->
-	<define name="attr-doc-lang">
-		<attribute name="lang">
-			<data type="language" />
-		</attribute>
-	</define>
-
-	<!-- documentation summary -->
-	<define name="element-doc-summary">
-		<element name="summary">
-			<optional>
-				<ref name="attr-doc-lang" />
-			</optional>
-			<ref name="doc-inline-content" />
-		</element>
-	</define>
-
-
-	<!-- documentation content -->
-	<!--
-	   Whitespace in documentation content is treated as follows:
-	   contiguous sequences of white space are replaced by a single 
-	   space and leading and trailing spaces are removed.
-	   Use CDATA sections to preserve white-space.
-	-->
-
-	<!-- inline content -->
-	<!-- 
-	   The doc-inline-content pattern contains one or more doc-inline 
-	   elements. However, a doc-inline element may not be nested within 
-	   another doc-inline element of the same type. 
-	-->
-	<define name="doc-inline-content">
-		<oneOrMore>
-			<ref name="doc-inline" />
-		</oneOrMore>
-	</define>
-
-	<!-- block content -->
-	<define name="doc-block-content">
-		<oneOrMore>
-			<ref name="doc-block" />
-		</oneOrMore>
-	</define>
-
-
-	<!-- the documentation element -->
-	<define name="documentation">
-		<optional>
-			<ref name="element-doc-summary" />
-		</optional>
-		<optional>
-			<element name="doc">
-				<optional>
-					<ref name="attr-doc-lang" />
-				</optional>
-				<choice>
-					<ref name="doc-inline-content" />
-					<ref name="doc-block-content" />
-				</choice>
-			</element>
-		</optional>
-	</define>
-</grammar>
-
--- a/usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADRdoc.xsd	Wed Mar 14 04:47:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-  
-  CDDL HEADER START
-  
-   The contents of this file are subject to the terms of the
-   Common Development and Distribution License (the "License").
-   You may not use this file except in compliance with the License.
-  
-   You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-   or http://www.opensolaris.org/os/licensing.
-   See the License for the specific language governing permissions
-   and limitations under the License.
-  
-   When distributing Covered Code, include this CDDL HEADER in each
-   file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-   If applicable, add the following below this CDDL HEADER, with the
-   fields enclosed by brackets "[]" replaced with your own identifying
-   information: Portions Copyright [yyyy] [name of copyright owner]
-  
-  CDDL HEADER END
--->
-<!-- ADRdoc.rng: ADR documentation -->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.opensolaris.org/ns/adr" xmlns:adr="http://www.opensolaris.org/ns/adr">
-  <!-- inline doc elements -->
-  <xs:group name="doc-inline">
-    <xs:sequence>
-      <xs:choice minOccurs="0">
-        <xs:element ref="adr:code"/>
-        <xs:element ref="adr:strong"/>
-        <xs:element ref="adr:link"/>
-        <xs:element ref="adr:br"/>
-      </xs:choice>
-    </xs:sequence>
-  </xs:group>
-  <!-- block doc elements -->
-  <xs:group name="doc-block">
-    <xs:choice>
-      <xs:element ref="adr:heading"/>
-      <xs:element ref="adr:para"/>
-      <xs:group ref="adr:element-doc-list"/>
-      <xs:element ref="adr:example"/>
-    </xs:choice>
-  </xs:group>
-  <!-- (inline) code snippet -->
-  <!-- A nested element-doc-code is not permitted. -->
-  <xs:element name="code">
-    <xs:complexType mixed="true">
-      <xs:group ref="adr:doc-inline-content"/>
-    </xs:complexType>
-  </xs:element>
-  <!-- (inline) strong/emphasis -->
-  <!-- A nested element-doc-strong is not permitted. -->
-  <xs:element name="strong">
-    <xs:complexType mixed="true">
-      <xs:group ref="adr:doc-inline-content"/>
-    </xs:complexType>
-  </xs:element>
-  <!-- (inline) url -->
-  <!-- A nested element-doc-link is not permitted. -->
-  <xs:element name="link">
-    <xs:complexType mixed="true">
-      <xs:group ref="adr:doc-inline-content"/>
-      <xs:attribute name="url" use="required"/>
-    </xs:complexType>
-  </xs:element>
-  <!-- (inline) line break -->
-  <xs:element name="br">
-    <xs:complexType/>
-  </xs:element>
-  <!-- (block) paragraph -->
-  <xs:element name="para">
-    <xs:complexType mixed="true">
-      <xs:group ref="adr:doc-inline-content"/>
-    </xs:complexType>
-  </xs:element>
-  <!-- (block) heading -->
-  <xs:element name="heading">
-    <xs:complexType mixed="true">
-      <xs:group ref="adr:doc-inline-content"/>
-    </xs:complexType>
-  </xs:element>
-  <!-- (block) example (code, preformatted) -->
-  <xs:element name="example">
-    <xs:complexType mixed="true">
-      <xs:attribute name="caption"/>
-    </xs:complexType>
-  </xs:element>
-  <!-- (block) list item -->
-  <xs:element name="item">
-    <xs:complexType mixed="true">
-      <xs:choice maxOccurs="unbounded">
-        <xs:group ref="adr:doc-inline"/>
-        <xs:group ref="adr:doc-block"/>
-      </xs:choice>
-    </xs:complexType>
-  </xs:element>
-  <!-- (block) list (rudimentary - ordered, unordered) -->
-  <!-- default = unordered list -->
-  <xs:group name="element-doc-list">
-    <xs:sequence>
-      <xs:element name="list">
-        <xs:complexType>
-          <xs:sequence>
-            <xs:element maxOccurs="unbounded" ref="adr:item"/>
-          </xs:sequence>
-          <xs:attribute name="type">
-            <xs:simpleType>
-              <xs:restriction base="xs:token">
-                <xs:enumeration value="unordered"/>
-                <xs:enumeration value="ordered"/>
-              </xs:restriction>
-            </xs:simpleType>
-          </xs:attribute>
-        </xs:complexType>
-      </xs:element>
-    </xs:sequence>
-  </xs:group>
-  <!-- documentation attributes -->
-  <!-- language -->
-  <xs:attributeGroup name="attr-doc-lang">
-    <xs:attribute name="lang" use="required" type="xs:language"/>
-  </xs:attributeGroup>
-  <!-- documentation summary -->
-  <xs:element name="summary">
-    <xs:complexType mixed="true">
-      <xs:group ref="adr:doc-inline-content"/>
-      <xs:attribute name="lang" type="xs:language"/>
-    </xs:complexType>
-  </xs:element>
-  <!-- documentation content -->
-  <!--
-    Whitespace in documentation content is treated as follows:
-    contiguous sequences of white space are replaced by a single 
-    space and leading and trailing spaces are removed.
-    Use CDATA sections to preserve white-space.
-  -->
-  <!-- inline content -->
-  <!--
-    The doc-inline-content pattern contains one or more doc-inline 
-    elements. However, a doc-inline element may not be nested within 
-    another doc-inline element of the same type. 
-  -->
-  <xs:group name="doc-inline-content">
-    <xs:sequence>
-      <xs:group maxOccurs="unbounded" ref="adr:doc-inline"/>
-    </xs:sequence>
-  </xs:group>
-  <!-- block content -->
-  <xs:group name="doc-block-content">
-    <xs:sequence>
-      <xs:group maxOccurs="unbounded" ref="adr:doc-block"/>
-    </xs:sequence>
-  </xs:group>
-  <!-- the documentation element -->
-  <xs:group name="documentation">
-    <xs:sequence>
-      <xs:element minOccurs="0" ref="adr:summary"/>
-      <xs:element minOccurs="0" ref="adr:doc"/>
-    </xs:sequence>
-  </xs:group>
-  <xs:element name="doc">
-    <xs:complexType mixed="true">
-      <xs:choice>
-        <xs:group ref="adr:doc-inline-content"/>
-        <xs:group ref="adr:doc-block-content"/>
-      </xs:choice>
-      <xs:attribute name="lang" type="xs:language"/>
-    </xs:complexType>
-  </xs:element>
-</xs:schema>
--- a/usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADRdocbook.xsl	Wed Mar 14 04:47:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,771 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
-  
-  CDDL HEADER START
-  
-   The contents of this file are subject to the terms of the
-   Common Development and Distribution License (the "License").
-   You may not use this file except in compliance with the License.
-  
-   You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-   or http://www.opensolaris.org/os/licensing.
-   See the License for the specific language governing permissions
-   and limitations under the License.
-  
-   When distributing Covered Code, include this CDDL HEADER in each
-   file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-   If applicable, add the following below this CDDL HEADER, with the
-   fields enclosed by brackets "[]" replaced with your own identifying
-   information: Portions Copyright [yyyy] [name of copyright owner]
-  
-  CDDL HEADER END
--->
-
-<xsl:stylesheet version="1.0" xmlns:adr="http://www.opensolaris.org/ns/adr"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-    <!-- Write the opening elements -->
-    <xsl:output method="xml" version="1.0" encoding="UTF-8" 
-	indent="no" omit-xml-declaration="no" standalone="yes" 
-	doctype-public="-//OASIS//DTD DocBook V4.4//EN"
-	doctype-system="http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"/>
-
-    <!-- Locale-specific content -->
-    <xsl:variable name="lang.title"> Interface Documentation</xsl:variable>
-    <xsl:variable name="lang.enumTitle">Enumerated Types</xsl:variable>
-    <xsl:variable name="lang.structTitle">Structure Types</xsl:variable>
-    <xsl:variable name="lang.unionTitle">Union Types</xsl:variable>
-    <xsl:variable name="lang.apiTitle">APIs</xsl:variable>
-    <xsl:variable name="lang.intfHead">interface </xsl:variable>
-    <xsl:variable name="lang.enumLabel">enum </xsl:variable>
-    <xsl:variable name="lang.fbLabel">fallback </xsl:variable>
-    <xsl:variable name="lang.structLabel">struct </xsl:variable>
-    <xsl:variable name="lang.unionLabel">union </xsl:variable>
-    <xsl:variable name="lang.armLabel">case </xsl:variable>
-    <xsl:variable name="lang.defaultarmLabel">default</xsl:variable>
-    <xsl:variable name="lang.apiHead">api </xsl:variable>
-    <xsl:variable name="lang.propHead"> Properties</xsl:variable>
-    <xsl:variable name="lang.methHead"> Methods</xsl:variable>
-    <xsl:variable name="lang.evHead"> Events</xsl:variable>
-    <xsl:variable name="lang.verLabel">Version - </xsl:variable>
-    <xsl:variable name="lang.incApiHead">from included </xsl:variable>
-    <xsl:variable name="lang.propLabel">property </xsl:variable>
-    <xsl:variable name="lang.typeLabel">Type: </xsl:variable>
-    <xsl:variable name="lang.roLabel">Read </xsl:variable>
-    <xsl:variable name="lang.woLabel">Write </xsl:variable>
-    <xsl:variable name="lang.rwLabel">Read-Write </xsl:variable>
-    <xsl:variable name="lang.roProp">R/O </xsl:variable>
-    <xsl:variable name="lang.woProp">W/O </xsl:variable>
-    <xsl:variable name="lang.rwProp">R/W </xsl:variable>
-    <xsl:variable name="lang.errLabel">Error: </xsl:variable>
-    <xsl:variable name="lang.methLabel">method </xsl:variable>
-    <xsl:variable name="lang.argLabel">Arguments: </xsl:variable>
-    <xsl:variable name="lang.resLabel">Result: </xsl:variable>
-    <xsl:variable name="lang.evLabel">event </xsl:variable>
-    <xsl:variable name="lang.voidLabel">void</xsl:variable>
-    <xsl:variable name="lang.optLabel">optional</xsl:variable>
-
-    <xsl:strip-space elements="*"/>
-
-    <xsl:template match="/">
-      <article>
-	<xsl:apply-templates/>
-      </article>
-    </xsl:template>
-
-    <!-- Process the interface element -->
-    <xsl:template match="adr:interface">
-      <!-- Write out a heading -->
-      <section>
-	<title>
-	  <xsl:value-of select="@name"/><xsl:value-of select="$lang.title"/>
-	</title>
-	<para>
-	  <emphasis role="strong">
-	    <xsl:value-of select="$lang.intfHead"/><xsl:value-of select="@name"/>
-	  </emphasis>
-	  <xsl:apply-templates select="adr:summary"/>
-	</para>
-	<xsl:apply-templates select="adr:doc"/>
-
-	<!-- Process the enum elements, if any -->
-	<xsl:if test="adr:enum">
-	  <section>
-	    <title><xsl:value-of select="$lang.enumTitle"/></title>
-	    <xsl:apply-templates select="adr:enum"/>
-	  </section>
-	</xsl:if>
-
-	<!-- Process the type elements, if any -->
-	<xsl:if test="adr:type">
-	  <section>
-	    <title><xsl:value-of select="$lang.structTitle"/></title>
-	    <xsl:apply-templates select="adr:type"/>
-	  </section>
-	</xsl:if>
-
-	<!-- Process the union elements, if any -->
-	<xsl:if test="adr:union">
-	  <section>
-	    <title><xsl:value-of select="$lang.unionTitle"/></title>
-	    <xsl:apply-templates select="adr:union"/>
-	  </section>
-	</xsl:if>
-
-	<!-- Process the api elements, if any -->
-	<xsl:if test="adr:api">
-	  <section>
-	    <title><xsl:value-of select="$lang.apiTitle"/></title>
-	    <xsl:apply-templates select="adr:api"/>
-	  </section>
-	</xsl:if>
-
-      </section>
-    </xsl:template>
-
-    <!-- Process the enum, enum value, enum fallback elements -->
-    <xsl:template match="adr:interface/adr:enum">
-      <para>
-	<xsl:attribute name="id"><xsl:value-of select="@name"/></xsl:attribute>
-	<emphasis role="strong">
-	  <xsl:value-of select="$lang.enumLabel"/>
-	  <type><xsl:value-of select="@name"/></type>
-	</emphasis>
-	<xsl:apply-templates select="adr:summary|adr:doc"/>
-	<simplelist type="vert">
-	  <xsl:call-template name="tenum"/>
-	  <xsl:apply-templates select="adr:fallback"/>
-	</simplelist>
-      </para>
-    </xsl:template>
-
-    <!-- Process all the enum value elements -->
-    <xsl:template name="tenum">
-      <xsl:param name="thenode" select="adr:value[1]"/>
-      <xsl:param name="initval" select="0"/>
-      <xsl:variable name="currvalue">
-	<xsl:choose>
-          <xsl:when test="$thenode/@value">
-            <xsl:value-of select="$thenode/@value"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="$initval"/>
-          </xsl:otherwise>
-	</xsl:choose>           
-      </xsl:variable>
-      <member>
-	<xsl:attribute name="id">
-	  <xsl:value-of select="concat(@name, '.', $thenode/@name)"/>
-	</xsl:attribute>
-	<literal moreinfo="none">
-	   <xsl:value-of select="$thenode/@name"/>
-	</literal>
-	<xsl:text> (</xsl:text>
-	<literal moreinfo="none">
-	  <xsl:value-of select="$currvalue"/>
-	</literal>
-	<xsl:text>)</xsl:text>
-	<xsl:apply-templates select="$thenode/adr:summary"/>
-	<xsl:apply-templates select="$thenode/adr:doc" mode="indent"/>
-      </member>
-      <xsl:if test="$thenode/following-sibling::adr:value[1]">
-	<xsl:call-template name="tenum">
-	  <xsl:with-param name="thenode" 
-	    select="$thenode/following-sibling::adr:value[1]"/>
-	  <xsl:with-param name="initval" select="$currvalue + 1"/>
-	</xsl:call-template>
-      </xsl:if>
-    </xsl:template>
-    
-    <!-- Process the enum fallback elements -->
-    <xsl:template match="adr:enum/adr:fallback">
-      <member>
-	<xsl:attribute name="id">
-	  <xsl:value-of select="concat(../@name, '.', @name)"/>
-	</xsl:attribute>
-	<xsl:value-of select="$lang.fbLabel"/>
-	<xsl:text>(</xsl:text>
-	<literal moreinfo="none">
-	   <xsl:value-of select="@name"/>
-	</literal>
-	<xsl:text>)</xsl:text>
-	<xsl:apply-templates select="adr:summary"/>
-	<xsl:apply-templates select="adr:doc" mode="indent"/>
-      </member>
-    </xsl:template>
-
-    <!-- Process the type (struct), type field, include elements -->
-    <xsl:template match="adr:interface/adr:type">
-      <para>
-	<xsl:attribute name="id"><xsl:value-of select="@name"/></xsl:attribute>
-	<emphasis role="strong">
-	  <xsl:value-of select="$lang.structLabel"/>
-	  <structname><xsl:value-of select="@name"/></structname>
-	</emphasis>
-	<xsl:apply-templates select="adr:summary|adr:doc"/>
-	<simplelist type="vert">
-	  <xsl:apply-templates select="adr:include"/>
-	  <xsl:apply-templates select="adr:field"/>
-	</simplelist>
-      </para>
-    </xsl:template>
-
-    <!-- Process the include elements within a type definition -->
-    <xsl:template match="adr:type/adr:include">
-      <xsl:apply-templates select="//adr:type[@name = current()/@typeref]"
-	  mode="include"/>
-    </xsl:template>
-    
-    <!-- Process the type field elements -->
-    <xsl:template match="adr:type/adr:field">
-      <member>
-	<xsl:call-template name="ttype"/>
-	<xsl:text> </xsl:text>
-	<structfield><xsl:value-of select="@name"/></structfield>
-	<xsl:call-template name="topt"/>
-	<xsl:apply-templates select="adr:summary"/>
-	<xsl:apply-templates select="adr:doc" mode="indent"/>
-      </member>
-    </xsl:template>
-
-    <!-- Process included type elements -->
-    <xsl:template match="adr:type" mode="include">
-      <xsl:apply-templates select="adr:field"/>
-    </xsl:template>
-
-    <!-- Process the union, arm elements -->
-    <xsl:template match="adr:interface/adr:union">
-      <para>
-	<xsl:attribute name="id"><xsl:value-of select="@name"/></xsl:attribute>
-	<emphasis role="strong">
-	  <xsl:value-of select="$lang.unionLabel"/>
-	  <structname><xsl:value-of select="@name"/></structname>
-	  <xsl:text> (</xsl:text>
-	    <xsl:call-template name="ttype"/>
-	  <xsl:text>)</xsl:text>
-	</emphasis>
-	<xsl:apply-templates select="adr:summary|adr:doc"/>
-	<simplelist type="vert">
-	  <xsl:apply-templates select="adr:arm"/>
-	  <xsl:apply-templates select="adr:default"/>
-	</simplelist>
-      </para>
-    </xsl:template>
-
-    <!-- Process the union arm elements -->
-    <xsl:template match="adr:union/adr:arm">
-      <member>
-        <xsl:value-of select="$lang.armLabel"/>
-	<literal moreinfo="none">
-	  <xsl:choose>
-	    <xsl:when test="../@typeref">
-	      <link>
-		<xsl:attribute name="linkend">
-		  <xsl:value-of select="concat(../@typeref, '.', @value)"/>
-		</xsl:attribute>
-		<xsl:value-of select="@value"/>
-	      </link>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:value-of select="@value"/>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</literal>
-	<xsl:text>: </xsl:text>
-	<xsl:call-template name="ttype"/>
-	<xsl:call-template name="topt"/>
-      </member>
-    </xsl:template>
-
-    <!-- Process the default union arm elements -->
-    <xsl:template match="adr:union/adr:default">
-      <member>
-        <xsl:value-of select="$lang.defaultarmLabel"/>
-	<xsl:text>: </xsl:text>
-	<xsl:call-template name="ttype"/>
-	<xsl:call-template name="topt"/>
-      </member>
-    </xsl:template>
-
-    <!-- Process the api, api property, api method, api event elements -->
-    <xsl:template match="adr:interface/adr:api">
-      <section>
-	<title>
-	  <xsl:attribute name="id">
-	    <xsl:value-of select="concat('api', @name)"/>
-	  </xsl:attribute>
-	  <xsl:value-of select="$lang.apiHead"/><xsl:value-of select="@name"/>
-	</title>
-	<para>
-	  <emphasis role="strong">
-	    <xsl:value-of select="$lang.apiHead"/><xsl:value-of select="@name"/>
-	  </emphasis>
-	  <xsl:apply-templates select="adr:summary|adr:doc"/>
-	</para>
-
-	<!-- Process the version elements, if any -->
-	<xsl:apply-templates select="adr:version[position() = 1]"/>
-
-	<!-- Save the "included" api, if any -->
-	<xsl:variable name="incApi" 
-	    select="//adr:api[@name = current()/adr:include/@typeref]"/>
-
-	<!-- Process the api properties, if any -->
-	<xsl:if test="adr:property">
-	  <section>
-	    <title>
-	      <xsl:value-of select="@name"/>
-	      <xsl:value-of select="$lang.propHead"/>
-	    </title>
-	    <xsl:apply-templates select="adr:property"/>
-	  </section>
-	</xsl:if>
-
-	<!-- Process the included api properties, if any -->
-	<xsl:if test="$incApi/adr:property">
-	  <section>
-	    <title>
-	      <xsl:value-of select="@name"/>
-	      <xsl:value-of select="$lang.propHead"/>
-	      <xsl:text> (</xsl:text>
-	      <xsl:value-of select="$lang.incApiHead"/>
-	      <link>
-		<xsl:attribute name="linkend">
-		  <xsl:value-of 
-		    select="concat('api', current()/adr:include/@typeref)"/>
-		</xsl:attribute>
-		<xsl:value-of select="$lang.apiHead"/>
-		<xsl:value-of select="current()/adr:include/@typeref"/>
-	      </link>
-	      <xsl:text>)</xsl:text>
-	    </title>
-	    <xsl:apply-templates select="$incApi/adr:property"/>
-	  </section>
-	</xsl:if>
-
-	<!-- Process the api methods, if any -->
-	<xsl:if test="adr:method">
-	  <section>
-	    <title>
-	      <xsl:value-of select="@name"/>
-	      <xsl:value-of select="$lang.methHead"/>
-	    </title>
-	    <xsl:apply-templates select="adr:method"/>
-	  </section>
-	</xsl:if>
-
-	<!-- Process the included api methods, if any -->
-	<xsl:if test="$incApi/adr:method">
-	  <section>
-	    <title>
-	      <xsl:value-of select="@name"/>
-	      <xsl:value-of select="$lang.methHead"/>
-	      <xsl:text> (</xsl:text>
-	      <xsl:value-of select="$lang.incApiHead"/>
-	      <link>
-		<xsl:attribute name="linkend">
-		  <xsl:value-of
-		    select="concat('api', current()/adr:include/@typeref)"/>
-		</xsl:attribute>
-		<xsl:value-of select="$lang.apiHead"/>
-		<xsl:value-of select="current()/adr:include/@typeref"/>
-	      </link>
-	      <xsl:text>)</xsl:text>
-	    </title>
-	    <xsl:apply-templates select="$incApi/adr:method"/>
-	  </section>
-	</xsl:if>
-
-	<!-- Process the api events, if any -->
-	<xsl:if test="adr:event">
-	  <section>
-	    <title>
-	      <xsl:value-of select="@name"/>
-	      <xsl:value-of select="$lang.evHead"/>
-	    </title>
-	    <xsl:apply-templates select="adr:event"/>
-	  </section>
-	</xsl:if>
-
-	<!-- Process the included api events, if any -->
-	<xsl:if test="$incApi/adr:event">
-	  <section>
-	    <title>
-	      <xsl:value-of select="@name"/>
-	      <xsl:value-of select="$lang.evHead"/>
-	      <xsl:text> (</xsl:text>
-	      <xsl:value-of select="$lang.incApiHead"/>
-	      <link>
-		<xsl:attribute name="linkend">
-		  <xsl:value-of 
-		    select="concat('api', current()/adr:include/@typeref)"/>
-		</xsl:attribute>
-		<xsl:value-of select="$lang.apiHead"/>
-		<xsl:value-of select="current()/adr:include/@typeref"/>
-	      </link>
-	      <xsl:text>)</xsl:text>
-	    </title>
-	    <xsl:apply-templates select="$incApi/adr:event"/>
-	  </section>
-	</xsl:if>
-
-      </section>
-    </xsl:template>
-
-    <!-- Process api version elements -->
-    <xsl:template match="adr:api/adr:version">
-      <para>
-	<xsl:value-of select="$lang.verLabel"/>
-	<xsl:for-each select="parent::node()/adr:version">
-	  <xsl:value-of select="@stability"/>
-	  <xsl:text>(</xsl:text>
-	  <xsl:value-of select="@major"/>
-	  <xsl:text>.</xsl:text>
-	  <xsl:value-of select="@minor"/>
-	  <xsl:text>)</xsl:text>
-	  <xsl:if test="position() != last()">, </xsl:if>
-	</xsl:for-each>
-      </para>
-    </xsl:template>
-
-    <!-- Process the property, property error elements -->
-    <xsl:template match="adr:property">
-      <para>
-	<emphasis role="strong">
-	  <xsl:call-template name="taccess"/>
-	  <xsl:value-of select="$lang.propLabel"/>
-	  <xsl:value-of select="@name"/>
-	</emphasis>
-	<xsl:apply-templates select="adr:summary|adr:doc"/>
-	<simplelist type="vert">
-	  <member>
-	    <xsl:value-of select="$lang.typeLabel"/>
-	    <xsl:call-template name="ttype"/>
-	    <xsl:call-template name="topt"/>
-	  </member>
-	  <xsl:apply-templates select="adr:error"/>
-	</simplelist>
-      </para>
-    </xsl:template>
-
-    <!-- Process the property error elements -->
-    <xsl:template match="adr:property/adr:error">
-      <member>
-	<xsl:choose>
-	  <xsl:when test="@for='ro' or parent::node()/@access='ro'">
-	    <xsl:value-of select="$lang.roLabel"/>
-	  </xsl:when>
-	  <xsl:when test="@for='wo' or parent::node()/@access='wo'">
-	    <xsl:value-of select="$lang.woLabel"/>
-	  </xsl:when>
-	  <xsl:when test="@for='rw' or parent::node()/@access='rw'">
-	    <xsl:value-of select="$lang.rwLabel"/>
-	  </xsl:when>
-	</xsl:choose>
-	<xsl:value-of select="$lang.errLabel"/>
-	<xsl:call-template name="ttype"/>
-	<xsl:apply-templates select="adr:summary"/>
-	<xsl:apply-templates select="adr:doc" mode="indent"/>
-      </member>
-    </xsl:template>
-    
-    <!-- Process the method, argument, result, error elements  -->
-    <xsl:template match="adr:api/adr:method">
-      <para>
-	<emphasis role="strong">
-	  <xsl:value-of select="$lang.methLabel"/>
-	  <xsl:value-of select="@name"/>
-	  <xsl:text>(</xsl:text>
-	  <xsl:if test="count(adr:argument) = 0">
-	    <xsl:text> </xsl:text>	    
-	  </xsl:if>
-	  <xsl:for-each select="adr:argument">
-	    <xsl:value-of select="@name"/>
-	    <xsl:if test="position() != last()">, </xsl:if>
-	  </xsl:for-each>
-	  <xsl:text>)</xsl:text>
-	</emphasis>
-	<xsl:apply-templates select="adr:summary|adr:doc"/>
-	<xsl:if test="count(adr:argument) > 0">
-	  <simplelist type="vert">
-	    <member>
-	      <para>
-	      <xsl:value-of select="$lang.argLabel"/>
-	      </para>
-	      <xsl:apply-templates select="adr:argument"/>
-	    </member>
-	  </simplelist>
-	</xsl:if>
-	<xsl:if test="count(adr:result) > 0">
-	  <simplelist type="vert">
-	    <member>
-	      <para>
-	      <xsl:value-of select="$lang.resLabel"/>
-	      </para>
-	      <xsl:apply-templates select="adr:result"/>
-	    </member>
-	  </simplelist>
-	</xsl:if>
-	<xsl:if test="count(adr:error) > 0">
-	  <simplelist type="vert">
-	    <member>
-	      <para>
-	      <xsl:value-of select="$lang.errLabel"/>
-	      </para>
-	      <xsl:apply-templates select="adr:error"/>
-	    </member>
-	  </simplelist>
-	</xsl:if>
-      </para>
-    </xsl:template>
-
-    <!-- Process the method argument elements -->
-    <xsl:template match="adr:method/adr:argument">
-      <para>
-	<xsl:call-template name="ttype"/>
-	<xsl:text> </xsl:text>
-	<xsl:value-of select="@name"/>
-	<xsl:call-template name="topt"/>
-	<xsl:apply-templates select="adr:summary"/>
-	<xsl:apply-templates select="adr:doc" mode="indent"/>
-	</para>
-    </xsl:template>
-
-    <!-- Process the method result elements -->
-    <xsl:template match="adr:method/adr:result">
-      <para>
-	<xsl:call-template name="ttype"/>
-	<xsl:call-template name="topt"/>
-	<xsl:apply-templates select="adr:summary"/>
-	<xsl:apply-templates select="adr:doc" mode="indent"/>
-	</para>
-    </xsl:template>
-
-    <!-- Process the method error elements -->
-    <xsl:template match="adr:method/adr:error">
-      <para>
-	<xsl:call-template name="ttype"/>
-	<xsl:apply-templates select="adr:summary"/>
-	<xsl:apply-templates select="adr:doc" mode="indent"/>
-	</para>
-    </xsl:template>
-
-    <!-- Process the event elements -->
-    <xsl:template match="adr:api/adr:event">
-      <para>
-	<emphasis role="strong">
-	  <xsl:value-of select="$lang.evLabel"/>
-	  <xsl:value-of select="@name"/>
-	</emphasis>
-	<xsl:apply-templates select="adr:summary|adr:doc"/>
-	<simplelist type="vert">
-	  <member>
-	    <xsl:value-of select="$lang.typeLabel"/>
-	    <xsl:call-template name="ttype"/>
-	  </member>
-	</simplelist>
-      </para>
-    </xsl:template>
-
-    <!-- Named Templates -->
-    <!-- Process type definition for structs fields, props, methods, events -->
-    <xsl:template name="ttype">
-      <xsl:choose>
-	<xsl:when test="@type">
-	  <type><xsl:value-of select="@type"/></type>
-	</xsl:when>
-	<xsl:when test="@typeref">
-	    <type>
-	      <link>
-		<xsl:attribute name="linkend">
-		  <xsl:value-of select="@typeref"/>
-		</xsl:attribute>
-		<xsl:apply-templates select=
-"(//adr:type|//adr:enum|//adr:union)[@name = current()/@typeref]"
-		  mode="refclass"/>
-		<xsl:value-of select="@typeref"/>
-	      </link>
-	    </type>
-	</xsl:when>
-	<xsl:when test="adr:list/@type">
-	  <type>
-	    <xsl:value-of select="adr:list/@type"/><xsl:text>[]</xsl:text>
-	  </type>
-	</xsl:when>
-	<xsl:when test="adr:list/@typeref">
-	    <type>
-	      <link>
-		<xsl:attribute name="linkend">
-		  <xsl:value-of select="adr:list/@typeref"/>
-		</xsl:attribute>
-		<xsl:apply-templates select=
-"(//adr:type|//adr:enum|//adr:union)[@name = current()/adr:list/@typeref]"
-		  mode="refclass"/>
-		<xsl:value-of select="adr:list/@typeref"/>
-	      </link>
-	      <xsl:text>[]</xsl:text>
-	    </type>
-	</xsl:when>
-	<xsl:otherwise>
-	  <type><xsl:value-of select="$lang.voidLabel"/></type>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
-
-    <!-- Process optional attribute for fields, props, args, results -->
-    <xsl:template name="topt">
-      <xsl:if test="@optional='true' or @optional='1'">
-	<xsl:text> (</xsl:text>
-	<emphasis><xsl:value-of select="$lang.optLabel"/></emphasis>
-	<xsl:text>)</xsl:text>
-      </xsl:if>
-    </xsl:template>
-
-    <!-- Process access attribute for properties -->
-    <xsl:template name="taccess">
-      <xsl:choose>
-	<xsl:when test="@access='ro'">
-	  <xsl:value-of select="$lang.roProp"/>
-	</xsl:when>
-	<xsl:when test="@access='wo'">
-	  <xsl:value-of select="$lang.woProp"/>
-	</xsl:when>
-	<xsl:otherwise> <!-- access=rw -->
-	  <xsl:value-of select="$lang.rwProp"/>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
-
-    <!-- Templates for type specification -->
-    <xsl:template match="adr:enum" mode="refclass">
-      <xsl:value-of select="$lang.enumLabel"/>
-    </xsl:template>
-
-    <xsl:template match="adr:type" mode="refclass">
-      <xsl:value-of select="$lang.structLabel"/>
-    </xsl:template> 
-
-    <xsl:template match="adr:union" mode="refclass">
-      <xsl:value-of select="$lang.unionLabel"/>
-    </xsl:template>
-
-    <!-- Process the documentation summary elements -->
-    <xsl:template match="adr:summary">
-      <xsl:text> &#x2014; </xsl:text> <!-- &mdash; -->
-      <xsl:apply-templates/>
-    </xsl:template>
-
-    <!-- Process the (detail) documentation elements -->
-    <xsl:template match="adr:doc">
-      <xsl:choose>
-	<xsl:when test="child::*[1][self::adr:para]">
-	  <xsl:apply-templates/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <para>
-	    <xsl:apply-templates/>
-	  </para>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
-
-    <!-- Process the (detail) documentation elements -->
-    <!-- Indent documentation if parent is itself indented -->
-    <xsl:template match="adr:doc" mode="indent">
-      <simplelist type="vert">
-	<member>
-	  <xsl:choose>
-	    <xsl:when test="child::*[1][self::adr:para]">
-	      <xsl:apply-templates/>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <para>
-		<xsl:apply-templates/>
-	      </para>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</member>
-      </simplelist>
-    </xsl:template>
-
-    <!-- Process the (inline) code doc elements -->
-    <xsl:template match="adr:summary//adr:code|adr:doc//adr:code">
-      <code>
-	<xsl:apply-templates/>
-      </code>
-    </xsl:template>
-
-    <!-- Process the (inline) strong doc elements -->
-    <xsl:template match="adr:summary//adr:strong|adr:doc//adr:strong">
-      <emphasis role="strong">
-	<xsl:apply-templates/>
-      </emphasis>
-    </xsl:template>
-
-    <!-- Process the (inline) link doc elements -->
-    <xsl:template match="adr:summary//adr:link|adr:doc//adr:link">
-      <ulink>
-	<xsl:attribute name="url">
-	  <xsl:value-of select="@url"/>
-	</xsl:attribute>
-	<xsl:apply-templates/>
-      </ulink>
-    </xsl:template>
-
-    <!-- Process the (inline) br doc elements -->
-    <xsl:template match="adr:summary//adr:br|adr:doc//adr:br">
-      <!-- Need a better way to simulate line breaks! -->
-      <literallayout format="linespecific" class="normal">
-      </literallayout>
-    </xsl:template>
-
-    <!-- Process the (block) heading doc elements -->
-    <xsl:template match="adr:doc/adr:heading">
-      <title>
-	<xsl:apply-templates/>
-      </title>
-    </xsl:template>
-
-    <!-- Process the (block) para doc elements -->
-    <xsl:template match="adr:doc/adr:para">
-      <para>
-	<xsl:apply-templates/>
-      </para>
-    </xsl:template>
-
-    <!-- Process the (block) list doc elements -->
-    <xsl:template match="adr:doc/adr:list">
-      <xsl:choose>
-	<xsl:when test="@type='ordered'">
-	  <orderedlist inheritnum="ignore" continuation="restarts">
-	    <xsl:apply-templates select="adr:item"/>
-	  </orderedlist>
-	</xsl:when>
-	<xsl:otherwise> <!-- default: unordered -->
-	  <itemizedlist>
-	    <xsl:apply-templates select="adr:item"/>
-	  </itemizedlist>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
-
-    <!-- Process the (block) list item doc elements -->
-    <xsl:template match="adr:list/adr:item">
-      <listitem>
-	<xsl:apply-templates/>
-      </listitem>
-    </xsl:template>
-
-    <!-- Process the (block) example doc elements -->
-    <xsl:template match="adr:doc/adr:example">
-      <example>
-	<xsl:attribute name="label">
-	  <xsl:value-of select="@caption"/>
-	</xsl:attribute>
-	<programlisting format="linespecific">
-	  <xsl:value-of select="self::node()"/>
-	</programlisting>
-      </example>
-    </xsl:template>
-</xsl:stylesheet>
--- a/usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADRrmdoc.xsl	Wed Mar 14 04:47:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
-  
-  CDDL HEADER START
-  
-   The contents of this file are subject to the terms of the
-   Common Development and Distribution License (the "License").
-   You may not use this file except in compliance with the License.
-  
-   You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-   or http://www.opensolaris.org/os/licensing.
-   See the License for the specific language governing permissions
-   and limitations under the License.
-  
-   When distributing Covered Code, include this CDDL HEADER in each
-   file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-   If applicable, add the following below this CDDL HEADER, with the
-   fields enclosed by brackets "[]" replaced with your own identifying
-   information: Portions Copyright [yyyy] [name of copyright owner]
-  
-  CDDL HEADER END
--->
-<!-- Strips documentation elements from ADR interface definitions -->
-<xsl:stylesheet version="1.0" xmlns:adr="http://www.opensolaris.org/ns/adr"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-    <xsl:output method="xml" version="1.0" encoding="UTF-8" 
-	indent="yes" omit-xml-declaration="no" standalone="yes"/>
-    <xsl:strip-space elements="*"/>
-
-    <!-- identity templates -->
-    <xsl:template match="node()|@*">
-        <xsl:copy>
-            <xsl:apply-templates select="@*|node()"/>
-        </xsl:copy>
-    </xsl:template>
-
-    <!-- strip out document elements -->
-    <xsl:template match="adr:summary |adr:doc"/>
-</xsl:stylesheet>
--- a/usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADRtext.xsl	Wed Mar 14 04:47:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,850 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
-  
-  CDDL HEADER START
-  
-   The contents of this file are subject to the terms of the
-   Common Development and Distribution License (the "License").
-   You may not use this file except in compliance with the License.
-  
-   You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-   or http://www.opensolaris.org/os/licensing.
-   See the License for the specific language governing permissions
-   and limitations under the License.
-  
-   When distributing Covered Code, include this CDDL HEADER in each
-   file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-   If applicable, add the following below this CDDL HEADER, with the
-   fields enclosed by brackets "[]" replaced with your own identifying
-   information: Portions Copyright [yyyy] [name of copyright owner]
-  
-  CDDL HEADER END
--->
-
-<xsl:stylesheet version="1.0" xmlns:adr="http://www.opensolaris.org/ns/adr"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-    <!-- Write the opening elements -->
-    <xsl:output method="text" version="1.0" encoding="UTF-8" 
-	indent="no" omit-xml-declaration="yes" standalone="yes"/>
-
-    <!-- Locale-specific content -->
-    <xsl:variable name="lang.title">INTERFACE DOCUMENTATION</xsl:variable>
-    <xsl:variable name="lang.enumTitle">Enumerated Types</xsl:variable>
-    <xsl:variable name="lang.structTitle">Structure Types</xsl:variable>
-    <xsl:variable name="lang.unionTitle">Union Types</xsl:variable>
-    <xsl:variable name="lang.apiTitle">APIs</xsl:variable>
-    <xsl:variable name="lang.intfHead">Interface </xsl:variable>
-    <xsl:variable name="lang.enumLabel">enum </xsl:variable>
-    <xsl:variable name="lang.fbLabel">fallback </xsl:variable>
-    <xsl:variable name="lang.structLabel">struct </xsl:variable>
-    <xsl:variable name="lang.unionLabel">union </xsl:variable>
-    <xsl:variable name="lang.armLabel">case </xsl:variable>
-    <xsl:variable name="lang.defaultarmLabel">default</xsl:variable>
-    <xsl:variable name="lang.apiHead">Api </xsl:variable>
-    <xsl:variable name="lang.propHead">Properties</xsl:variable>
-    <xsl:variable name="lang.methHead">Methods</xsl:variable>
-    <xsl:variable name="lang.evHead">Events</xsl:variable>
-    <xsl:variable name="lang.verLabel">Version - </xsl:variable>
-    <xsl:variable name="lang.incApiHead">From Included </xsl:variable>
-    <xsl:variable name="lang.propLabel">Property: </xsl:variable>
-    <xsl:variable name="lang.typeLabel">Type: </xsl:variable>
-    <xsl:variable name="lang.roLabel">Read </xsl:variable>
-    <xsl:variable name="lang.woLabel">Write </xsl:variable>
-    <xsl:variable name="lang.rwLabel">Read-Write </xsl:variable>
-    <xsl:variable name="lang.roProp">Read-Only</xsl:variable>
-    <xsl:variable name="lang.woProp">Write-Only</xsl:variable>
-    <xsl:variable name="lang.rwProp">Read-Write</xsl:variable>
-    <xsl:variable name="lang.errLabel">Error:</xsl:variable>
-    <xsl:variable name="lang.methLabel">Method: </xsl:variable>
-    <xsl:variable name="lang.argLabel">Arguments:</xsl:variable>
-    <xsl:variable name="lang.resLabel">Result:</xsl:variable>
-    <xsl:variable name="lang.evLabel">Event: </xsl:variable>
-    <xsl:variable name="lang.voidLabel">void</xsl:variable>
-    <xsl:variable name="lang.optLabel">Optional</xsl:variable>
-
-    <xsl:variable name="indentstr" select="'             '"/>
-
-    <xsl:strip-space elements="*"/>
-
-    <xsl:template match="text()"/>
-
-    <xsl:template match="/">
-      <xsl:value-of select="$lang.title"/>
-	<xsl:call-template name="tunderline">
-	  <xsl:with-param name="title" select="$lang.title"/>
-	</xsl:call-template>
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:apply-templates/>
-    </xsl:template>
-
-    <!-- Process the interface element -->
-    <xsl:template match="adr:interface">
-      <!-- Write out a heading -->
-      <xsl:text>&#xA;</xsl:text>	  
-      <xsl:text>  </xsl:text> <!-- indent = 2 -->
-      <xsl:value-of select="$lang.intfHead"/>
-      <xsl:value-of select="@name"/>
-      <xsl:apply-templates select="adr:summary"/>
-      <xsl:apply-templates select="adr:doc">
-	<xsl:with-param name="indent" select="4"/>	
-      </xsl:apply-templates>
-      <xsl:if test="not(child::*[1][self::adr:summary|self::adr:doc])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-      
-      <!-- Process the enum elements, if any -->
-      <xsl:if test="adr:enum">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>    </xsl:text> <!-- indent = 4 -->
-	<xsl:value-of select="$lang.enumTitle"/>
-	<xsl:call-template name="tunderline">
-	  <xsl:with-param name="title" select="$lang.enumTitle"/>
-	  <xsl:with-param name="indent" select="4"/>
-	</xsl:call-template>
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:apply-templates select="adr:enum"/>
-      </xsl:if>
-      
-      <!-- Process the type elements, if any -->
-      <xsl:if test="adr:type">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>    </xsl:text> <!-- indent = 4 -->
-	<xsl:value-of select="$lang.structTitle"/>
-	<xsl:call-template name="tunderline">
-	  <xsl:with-param name="title" select="$lang.structTitle"/>
-	  <xsl:with-param name="indent" select="4"/>
-	</xsl:call-template>
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:apply-templates select="adr:type"/>
-      </xsl:if>
-
-      <!-- Process the union elements, if any -->
-      <xsl:if test="adr:union">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>    </xsl:text> <!-- indent = 4 -->
-	<xsl:value-of select="$lang.unionTitle"/>
-	<xsl:call-template name="tunderline">
-	  <xsl:with-param name="title" select="$lang.unionTitle"/>
-	  <xsl:with-param name="indent" select="4"/>
-	</xsl:call-template>
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:apply-templates select="adr:union"/>
-      </xsl:if>
-
-      <!-- Process the api elements, if any -->
-      <xsl:if test="adr:api">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>    </xsl:text> <!-- indent = 4 -->
-	<xsl:value-of select="$lang.apiTitle"/>
-	<xsl:call-template name="tunderline">
-	  <xsl:with-param name="title" select="$lang.apiTitle"/>
-	  <xsl:with-param name="indent" select="4"/>
-	</xsl:call-template>
-	<xsl:apply-templates select="adr:api"/>
-      </xsl:if>
-    </xsl:template>
-
-    <!-- Process the enum, enum value, enum fallback elements -->
-    <xsl:template match="adr:interface/adr:enum">
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:text>    </xsl:text> <!-- indent = 4 -->
-      <xsl:value-of select="$lang.enumLabel"/>
-      <xsl:value-of select="@name"/>
-      <xsl:apply-templates select="adr:summary"/>
-      <xsl:apply-templates select="adr:doc">
-	<xsl:with-param name="indent" select="4"/>
-      </xsl:apply-templates>
-      <xsl:if test="not(child::*[1][self::adr:summary|self::adr:doc])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:call-template name="tenum"/>
-      <xsl:apply-templates select="adr:fallback"/>
-    </xsl:template>
-
-    <!-- Process all the enum value elements -->
-    <xsl:template name="tenum">
-      <xsl:param name="thenode" select="adr:value[1]"/>
-      <xsl:param name="initval" select="0"/>
-      <xsl:variable name="currvalue">
-	<xsl:choose>
-          <xsl:when test="$thenode/@value">
-            <xsl:value-of select="$thenode/@value"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="$initval"/>
-          </xsl:otherwise>
-	</xsl:choose>           
-      </xsl:variable>
-
-      <xsl:text>      </xsl:text> <!-- indent = 6 -->
-      <xsl:value-of select="$thenode/@name"/>
-      <xsl:text> (</xsl:text>
-      <xsl:value-of select="$currvalue"/>
-      <xsl:text>)</xsl:text>
-      <xsl:apply-templates select="$thenode/adr:summary"/>
-      <xsl:apply-templates select="$thenode/adr:doc">
-	<xsl:with-param name="indent" select="8"/>
-      </xsl:apply-templates>
-      <xsl:if test="not($thenode/adr:summary)">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-
-      <xsl:if test="$thenode/following-sibling::adr:value[1]">
-	<xsl:call-template name="tenum">
-	  <xsl:with-param name="thenode" 
-	    select="$thenode/following-sibling::adr:value[1]"/>
-	  <xsl:with-param name="initval" select="$currvalue + 1"/>
-	</xsl:call-template>
-      </xsl:if>
-    </xsl:template>
-
-    <!-- Process the enum fallback elements -->
-    <xsl:template match="adr:enum/adr:fallback">
-      <xsl:text>      </xsl:text> <!-- indent = 6 -->
-      <xsl:value-of select="$lang.fbLabel"/>
-      <xsl:text>(</xsl:text>
-      <xsl:value-of select="@name"/>
-      <xsl:text>)</xsl:text>
-      <xsl:apply-templates select="adr:summary"/>
-      <xsl:apply-templates select="adr:doc">
-	<xsl:with-param name="indent" select="8"/>
-      </xsl:apply-templates>
-      <xsl:if test="not(child::*[1][self::adr:summary])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-    </xsl:template>
-    
-    <!-- Process the type (struct), type field, include elements -->
-    <xsl:template match="adr:interface/adr:type">
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:text>    </xsl:text> <!-- indent = 4 -->
-      <xsl:value-of select="$lang.structLabel"/>
-      <xsl:value-of select="@name"/>
-      <xsl:apply-templates select="adr:summary"/>
-      <xsl:apply-templates select="adr:doc">
-	<xsl:with-param name="indent" select="4"/>
-      </xsl:apply-templates>
-      <xsl:if test="not(child::*[1][self::adr:summary|self::adr:doc])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:apply-templates select="adr:include"/>
-      <xsl:apply-templates select="adr:field"/>
-    </xsl:template>
-
-    <!-- Process the union, arm elements -->
-    <xsl:template match="adr:interface/adr:union">
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:text>    </xsl:text> <!-- indent = 4 -->
-      <xsl:value-of select="$lang.unionLabel"/>
-      <xsl:value-of select="@name"/>
-      <xsl:text> (</xsl:text>
-      <xsl:call-template name="ttype"/>
-      <xsl:text>)</xsl:text>
-      <xsl:apply-templates select="adr:summary"/>
-      <xsl:apply-templates select="adr:doc">
-	<xsl:with-param name="indent" select="4"/>
-      </xsl:apply-templates>
-      <xsl:if test="not(child::*[1][self::adr:summary|self::adr:doc])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:apply-templates select="adr:arm"/>
-      <xsl:apply-templates select="adr:default"/>
-    </xsl:template>
-
-    <!-- Process the union arm elements -->
-    <xsl:template match="adr:union/adr:arm">
-      <xsl:text>      </xsl:text> <!-- indent = 6 -->
-      <xsl:value-of select="$lang.armLabel"/>
-      <xsl:value-of select="@value"/>
-      <xsl:text>: </xsl:text>
-      <xsl:call-template name="ttype"/>
-      <xsl:call-template name="topt"/>
-      <xsl:text>&#xA;</xsl:text>
-    </xsl:template>
-
-    <!-- Process the default union arm elements -->
-    <xsl:template match="adr:union/adr:default">
-      <xsl:text>      </xsl:text> <!-- indent = 6 -->
-      <xsl:value-of select="$lang.defaultarmLabel"/>
-      <xsl:text>: </xsl:text>
-      <xsl:call-template name="ttype"/>
-      <xsl:call-template name="topt"/>
-      <xsl:text>&#xA;</xsl:text>
-    </xsl:template>
-    
-    <!-- Process the include elements within a type definition -->
-    <xsl:template match="adr:type/adr:include">
-      <xsl:apply-templates select="//adr:type[@name = current()/@typeref]"
-	mode="include"/>
-    </xsl:template>
-    
-    <!-- Process the type field elements -->
-    <xsl:template match="adr:type/adr:field">
-      <xsl:text>      </xsl:text> <!-- indent = 6 -->
-      <xsl:value-of select="@name"/>
-      <xsl:text> (</xsl:text>
-      <xsl:call-template name="ttype"/>
-      <xsl:call-template name="topt"/>
-      <xsl:text>)</xsl:text>
-      <xsl:apply-templates select="adr:summary"/>
-      <xsl:apply-templates select="adr:doc">
-	<xsl:with-param name="indent" select="8"/>
-      </xsl:apply-templates>
-      <xsl:if test="not(child::*[1][self::adr:summary])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-    </xsl:template>
-    
-    <!-- Process included type elements -->
-    <xsl:template match="adr:type" mode="include">
-      <xsl:apply-templates select="adr:field"/>
-    </xsl:template>
-    
-    <!-- Process the api, api property, api method, api event elements -->
-    <xsl:template match="adr:interface/adr:api">
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:text>    </xsl:text> <!-- indent = 4 -->
-      <xsl:value-of select="$lang.apiHead"/>
-      <xsl:value-of select="@name"/>
-      <xsl:apply-templates select="adr:summary"/>
-      <xsl:apply-templates select="adr:doc">
-	<xsl:with-param name="indent" select="6"/>
-      </xsl:apply-templates>
-      <xsl:if test="not(child::*[1][self::adr:summary|self::adr:doc])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-
-      <!-- Process the version elements, if any -->
-      <xsl:apply-templates select="adr:version[position() = 1]"/>
-      
-      <!-- Save the "included" api, if any -->
-      <xsl:variable name="incApi" 
-	  select="//adr:api[@name = current()/adr:include/@typeref]"/>
-      
-      <!-- Write a properties header, if needed -->
-      <xsl:if test="adr:property | $incApi/adr:property">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>    </xsl:text> <!-- indent = 4 -->
-	<xsl:value-of select="$lang.propHead"/>
-	<xsl:call-template name="tunderline">
-	  <xsl:with-param name="title" select="$lang.propHead"/>
-	  <xsl:with-param name="indent" select="4"/>
-	</xsl:call-template>
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-
-      <!-- Process the api properties, if any -->
-      <xsl:if test="adr:property">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>    </xsl:text> <!-- indent = 4 -->
-	<xsl:value-of select="@name"/>
-	<xsl:text> </xsl:text>
-	<xsl:value-of select="$lang.propHead"/>
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:apply-templates select="adr:property"/>
-      </xsl:if>
-
-      <!-- Process the included api properties, if any -->
-      <xsl:if test="$incApi/adr:property">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>    </xsl:text> <!-- indent = 4 -->
-	<xsl:value-of select="@name"/>
-	<xsl:text> </xsl:text>
-	<xsl:value-of select="$lang.propHead"/>
-	<xsl:text> (</xsl:text>
-	<xsl:value-of select="$lang.incApiHead"/>
-	<xsl:value-of select="$lang.apiHead"/>
-	<xsl:value-of select="current()/adr:include/@typeref"/>
-	<xsl:text>)</xsl:text>
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:apply-templates select="$incApi/adr:property"/>
-      </xsl:if>
-
-      <!-- Write a methods header, if needed -->
-      <xsl:if test="adr:method | $incApi/adr:method">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>    </xsl:text> <!-- indent = 4 -->
-	<xsl:value-of select="$lang.methHead"/>
-	<xsl:call-template name="tunderline">
-	  <xsl:with-param name="title" select="$lang.methHead"/>
-	  <xsl:with-param name="indent" select="4"/>
-	</xsl:call-template>
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-
-      <!-- Process the api methods, if any -->
-      <xsl:if test="adr:method">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>    </xsl:text> <!-- indent = 4 -->
-	<xsl:value-of select="@name"/>
-	<xsl:text> </xsl:text>
-	<xsl:value-of select="$lang.methHead"/>
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:apply-templates select="adr:method"/>
-      </xsl:if>
-
-      <!-- Process the included api methods, if any -->
-      <xsl:if test="$incApi/adr:method">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>    </xsl:text> <!-- indent = 4 -->
-	<xsl:value-of select="@name"/>
-	<xsl:text> </xsl:text>
-	<xsl:value-of select="$lang.methHead"/>
-	<xsl:text> (</xsl:text>
-	<xsl:value-of select="$lang.incApiHead"/>
-	<xsl:value-of select="$lang.apiHead"/>
-	<xsl:value-of select="current()/adr:include/@typeref"/>
-	<xsl:text>)</xsl:text>
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:apply-templates select="$incApi/adr:method"/>
-      </xsl:if>
-
-      <!-- Write an events header, if needed -->
-      <xsl:if test="adr:event | $incApi/adr:event">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>    </xsl:text> <!-- indent = 4 -->
-	<xsl:value-of select="$lang.evHead"/>
-	<xsl:call-template name="tunderline">
-	  <xsl:with-param name="title" select="$lang.evHead"/>
-	  <xsl:with-param name="indent" select="4"/>
-	</xsl:call-template>
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-
-      <!-- Process the api events, if any -->
-      <xsl:if test="adr:event">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>    </xsl:text> <!-- indent = 4 -->
-	<xsl:value-of select="@name"/>
-	<xsl:text> </xsl:text>
-	<xsl:value-of select="$lang.evHead"/>
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:apply-templates select="adr:event"/>
-      </xsl:if>
-
-      <!-- Process the included api events, if any -->
-      <xsl:if test="$incApi/adr:event">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>    </xsl:text> <!-- indent = 4 -->
-	<xsl:value-of select="@name"/>
-	<xsl:text> </xsl:text>
-	<xsl:value-of select="$lang.evHead"/>
-	<xsl:text> (</xsl:text>
-	<xsl:value-of select="$lang.incApiHead"/>
-	<xsl:value-of select="$lang.apiHead"/>
-	<xsl:value-of select="current()/adr:include/@typeref"/>
-	<xsl:text>)</xsl:text>
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:apply-templates select="$incApi/adr:event"/>
-      </xsl:if>
-
-    </xsl:template> <!-- end api property, api method, api event elements -->
-
-    <!-- Process api version elements -->
-    <xsl:template match="adr:api/adr:version">
-      <xsl:text>      </xsl:text> <!-- indent = 6 -->
-      <xsl:value-of select="$lang.verLabel"/>
-      <xsl:for-each select="parent::node()/adr:version">
-	<xsl:value-of select="@stability"/>
-	<xsl:text>(</xsl:text>
-	<xsl:value-of select="@major"/>
-	<xsl:text>.</xsl:text>
-	<xsl:value-of select="@minor"/>
-	<xsl:text>)</xsl:text>
-	<xsl:if test="position() != last()">, </xsl:if>
-      </xsl:for-each>
-      <xsl:text>&#xA;</xsl:text>
-    </xsl:template>
-
-    <!-- Process the property, property error elements -->
-    <xsl:template match="adr:property">
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:text>      </xsl:text> <!-- indent = 6 -->
-      <xsl:value-of select="$lang.propLabel"/>
-      <xsl:value-of select="@name"/>
-      <xsl:text> (</xsl:text>
-      <xsl:call-template name="ttype"/>
-      <xsl:text>, </xsl:text>
-      <xsl:call-template name="taccess"/>
-      <xsl:call-template name="topt"/>
-      <xsl:text>)</xsl:text>
-      <xsl:apply-templates select="adr:summary"/>
-      <xsl:apply-templates select="adr:doc">
-	<xsl:with-param name="indent" select="6"/>
-      </xsl:apply-templates>
-      <xsl:if test="not(child::*[1][self::adr:summary|self::adr:doc])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-      <xsl:apply-templates select="adr:error"/>
-    </xsl:template>
-
-    <!-- Process the property error elements -->
-    <xsl:template match="adr:property/adr:error">
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:text>        </xsl:text> <!-- indent = 8 -->
-      <xsl:choose>
-	<xsl:when test="@for='ro' or parent::node()/@access='ro'">
-	  <xsl:value-of select="$lang.roLabel"/>
-	</xsl:when>
-	<xsl:when test="@for='wo' or parent::node()/@access='wo'">
-	  <xsl:value-of select="$lang.woLabel"/>
-	</xsl:when>
-	<xsl:when test="@for='rw' or parent::node()/@access='rw'">
-	  <xsl:value-of select="$lang.rwLabel"/>
-	</xsl:when>
-      </xsl:choose>
-      <xsl:value-of select="$lang.errLabel"/>
-      <xsl:text> </xsl:text>
-      <xsl:call-template name="ttype"/>
-      <xsl:apply-templates select="adr:summary"/>
-      <xsl:apply-templates select="adr:doc">
-	<xsl:with-param name="indent" select="10"/>
-      </xsl:apply-templates>
-      <xsl:if test="not(child::*[1][self::adr:summary|self::adr:doc])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-    </xsl:template>
-    
-    <!-- Process the method, argument, result, method error elements -->
-    <xsl:template match="adr:api/adr:method">
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:text>      </xsl:text> <!-- indent = 6 -->
-      <xsl:value-of select="$lang.methLabel"/>
-      <xsl:value-of select="@name"/>
-      <xsl:text>(</xsl:text>
-      <xsl:for-each select="adr:argument">
-	<xsl:value-of select="@name"/>
-	<xsl:if test="position() != last()">, </xsl:if>
-      </xsl:for-each>
-      <xsl:text>)</xsl:text>
-      <xsl:apply-templates select="adr:summary"/>
-      <xsl:apply-templates select="adr:doc">
-	<xsl:with-param name="indent" select="6"/>
-      </xsl:apply-templates>
-      <xsl:if test="not(child::*[1][self::adr:summary|self::adr:doc])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-      <xsl:if test="count(adr:argument) > 0">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>        </xsl:text> <!-- indent = 8 -->
-	<xsl:value-of select="$lang.argLabel"/>
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:apply-templates select="adr:argument"/>
-      </xsl:if>
-      <xsl:if test="count(adr:result) > 0">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>        </xsl:text> <!-- indent = 8 -->
-	<xsl:value-of select="$lang.resLabel"/>
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:apply-templates select="adr:result"/>
-      </xsl:if>
-      <xsl:if test="count(adr:error) > 0">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:text>        </xsl:text> <!-- indent = 8 -->
-	<xsl:value-of select="$lang.errLabel"/>
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:apply-templates select="adr:error"/>
-      </xsl:if>
-    </xsl:template>
-
-    <!-- Process the method argument elements -->
-    <xsl:template match="adr:method/adr:argument">
-      <xsl:text>        </xsl:text> <!-- indent = 8 -->
-      <xsl:value-of select="@name"/>
-      <xsl:text> (</xsl:text>
-      <xsl:call-template name="ttype"/>
-      <xsl:call-template name="topt"/>
-      <xsl:text>)</xsl:text>
-      <xsl:apply-templates select="adr:summary"/>
-      <xsl:apply-templates select="adr:doc">
-	<xsl:with-param name="indent" select="10"/>
-      </xsl:apply-templates>
-      <xsl:if test="not(child::*[1][self::adr:summary|self::adr:doc])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-    </xsl:template>
-    
-    <!-- Process the method result elements -->
-    <xsl:template match="adr:method/adr:result">
-      <xsl:text>        </xsl:text> <!-- indent = 8 -->
-      <xsl:call-template name="ttype"/>
-      <xsl:if test="@optional='true' or @optional='1'">
-	<xsl:text> (</xsl:text>
-	<xsl:value-of select="$lang.optLabel"/>
-	<xsl:text>)</xsl:text>
-      </xsl:if>
-      <xsl:apply-templates select="adr:summary"/>
-      <xsl:apply-templates select="adr:doc">
-	<xsl:with-param name="indent" select="10"/>
-      </xsl:apply-templates>
-      <xsl:if test="not(child::*[1][self::adr:summary|self::adr:doc])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-    </xsl:template>
-    
-    <!-- Process the method error elements -->
-    <xsl:template match="adr:method/adr:error">
-      <xsl:text>        </xsl:text> <!-- indent = 8 -->
-      <xsl:call-template name="ttype"/>
-      <xsl:apply-templates select="adr:summary"/>
-      <xsl:apply-templates select="adr:doc">
-	<xsl:with-param name="indent" select="10"/>
-      </xsl:apply-templates>
-      <xsl:if test="not(child::*[1][self::adr:summary|self::adr:doc])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-    </xsl:template>
-
-    <!-- Process the event elements -->
-    <xsl:template match="adr:api/adr:event">
-      <xsl:text>&#xA;</xsl:text> 
-      <xsl:text>      </xsl:text> <!-- indent = 6 -->
-      <xsl:value-of select="$lang.evLabel"/>
-      <xsl:value-of select="@name"/>
-      <xsl:apply-templates select="adr:summary"/>
-      <xsl:apply-templates select="adr:doc">
-	<xsl:with-param name="indent" select="8"/>
-      </xsl:apply-templates>
-      <xsl:if test="not(child::*[1][self::adr:summary|self::adr:doc])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:text>        </xsl:text> <!-- indent = 8 -->
-      <xsl:value-of select="$lang.typeLabel"/>
-      <xsl:call-template name="ttype"/>
-      <xsl:text>&#xA;</xsl:text>
-    </xsl:template>
-
-    <!-- Named Templates -->
-    <!-- Process type definition for structs fields, props, methods, events -->
-    <xsl:template name="ttype">
-      <xsl:choose>
-	<xsl:when test="@type">
-	  <xsl:value-of select="@type"/>
-	</xsl:when>
-	<xsl:when test="@typeref">
-	  <xsl:apply-templates select=
-	     "(//adr:type|//adr:enum|//adr:union)[@name = current()/@typeref]"
-	     mode="refclass"/>
-	  <xsl:value-of select="@typeref"/>
-	</xsl:when>
-	<xsl:when test="adr:list/@type">
-	  <xsl:value-of select="adr:list/@type"/><xsl:text>[]</xsl:text>
-	</xsl:when>
-	<xsl:when test="adr:list/@typeref">
-	  <xsl:apply-templates select=
-"(//adr:type|//adr:enum|//adr:union)[@name = current()/adr:list/@typeref]"
-	     mode="refclass"/>
-	  <xsl:value-of select="adr:list/@typeref"/>
-	  <xsl:text>[]</xsl:text>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:value-of select="$lang.voidLabel"/>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
-
-    <!-- Process optional attribute for struct fields, methods -->
-    <xsl:template name="topt">
-      <xsl:if test="@optional='true' or @optional='1'">
-	<xsl:text>, </xsl:text>
-	<xsl:value-of select="$lang.optLabel"/>
-      </xsl:if>
-    </xsl:template>
-
-    <!-- Process access attribute for properties -->
-    <xsl:template name="taccess">
-      <xsl:choose>
-	<xsl:when test="@access='ro'">
-	  <xsl:value-of select="$lang.roProp"/>
-	</xsl:when>
-	<xsl:when test="@access='wo'">
-	  <xsl:value-of select="$lang.woProp"/>
-	</xsl:when>
-	<xsl:otherwise> <!-- access=rw -->
-	  <xsl:value-of select="$lang.rwProp"/>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
-
-    <!-- Output formatting -->
-    <xsl:template name="tunderline">
-      <xsl:param name="title" select="''"/>
-      <xsl:param name="indent" select="0"/>
-      <xsl:param name="len" select="string-length($title)"/>
-      <xsl:if test="string-length($title) > 0">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:value-of select="substring($indentstr, 1, $indent)"/>
-      </xsl:if>
-      <xsl:if test="$len > 0">
-	<xsl:text>-</xsl:text>
-	<xsl:call-template name="tunderline">
-	  <xsl:with-param name="len" select="$len - 1"/>
-	</xsl:call-template>
-      </xsl:if>
-    </xsl:template>
-      
-    <!-- Templates for type specification -->
-    <xsl:template match="adr:enum" mode="refclass">
-      <xsl:value-of select="$lang.enumLabel"/>
-    </xsl:template>
-
-    <xsl:template match="adr:type" mode="refclass">
-      <xsl:value-of select="$lang.structLabel"/>
-    </xsl:template> 
-
-    <xsl:template match="adr:union" mode="refclass">
-      <xsl:value-of select="$lang.unionLabel"/>
-    </xsl:template>
-
-    <!-- Process the documentation elements - adr:summary, adr:doc -->
-    <!-- Process the documentation summary elements -->
-    <xsl:template match="adr:summary">
-      <xsl:text> -- </xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>&#xA;</xsl:text>
-    </xsl:template>
-
-    <!-- Process the summary text nodes -->
-    <xsl:template match="adr:summary//text()">
-      <xsl:value-of select="normalize-space(.)"/>
-    </xsl:template>
-
-    <!-- Process the (inline) code doc elements -->
-    <xsl:template match="adr:summary//adr:code|adr:doc//adr:code">
-      <xsl:if test="preceding-sibling::node()">
-	<xsl:text> </xsl:text>
-      </xsl:if>
-      <xsl:apply-templates/>
-      <xsl:if test="following-sibling::node()">
-	<xsl:text> </xsl:text>
-      </xsl:if>
-    </xsl:template>
-
-    <!-- Process the (inline) strong doc elements -->
-    <xsl:template match="adr:summary//adr:strong|adr:doc//adr:strong">
-      <xsl:if test="preceding-sibling::node()">
-	<xsl:text> </xsl:text>
-      </xsl:if>
-      <xsl:apply-templates/>
-      <xsl:if test="following-sibling::node()">
-	<xsl:text> </xsl:text>
-      </xsl:if>
-    </xsl:template>
-
-    <!-- Process the (inline) link doc elements -->
-    <xsl:template match="adr:summary//adr:link|adr:doc//adr:link">
-      <xsl:text> (</xsl:text>
-      <xsl:value-of select="@url"/>
-      <xsl:text>) </xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text> </xsl:text>
-    </xsl:template>
-
-    <!-- Process the (inline) br doc elements -->
-    <xsl:template match="adr:summary//adr:br|adr:doc//adr:br">
-      <xsl:text>&#xA;</xsl:text>
-    </xsl:template>
-
-    <!-- Process the detail documentation (doc) elements -->
-    <xsl:template match="adr:doc">
-      <xsl:param name="indent" select="0"/>
-      <xsl:if test="not(child::*[1][self::adr:para])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-      <xsl:apply-templates select="text()[normalize-space(.) != '']|*">
-	<xsl:with-param name="indent" select="$indent"/>
-      </xsl:apply-templates>
-      <xsl:if test="not(child::*[last()][self::adr:para])">
-	<xsl:text>&#xA;</xsl:text>
-      </xsl:if>
-    </xsl:template>
-
-    <!-- Process the doc text nodes -->
-    <xsl:template match="adr:doc//text()">
-      <xsl:param name="indent" select="0"/>
-      <xsl:if test="$indent > 0">
-	<!-- If a text node is the first element or if a text node occurs right 
-	     after a br element, indent the text on output -->
-	<xsl:if test=
-	  "(not(preceding-sibling::*))or preceding-sibling::*[1][self::adr:br]">
-	  <xsl:value-of select="substring($indentstr, 1, $indent)"/>
-	</xsl:if>
-      </xsl:if>
-      <xsl:value-of select="normalize-space(.)"/>
-    </xsl:template>
-
-    <!-- Process the (block) heading doc elements -->
-    <xsl:template match="adr:doc//adr:heading">
-      <xsl:param name="indent" select="0"/>
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:if test="$indent > 0">
-	<xsl:value-of select="substring($indentstr, 1, $indent)"/>
-      </xsl:if>
-      <xsl:variable name="heading">
-	<xsl:value-of select="normalize-space(.)"/>
-      </xsl:variable>
-      <xsl:value-of select="$heading"/>
-      <xsl:call-template name="tunderline">
-	<xsl:with-param name="indent" select="$indent"/>
-	<xsl:with-param name="title" select="$heading"/>
-      </xsl:call-template>
-      <xsl:text>&#xA;</xsl:text>
-    </xsl:template>
-
-    <!-- Process the (block) para doc elements -->
-    <xsl:template match="adr:doc//adr:para">
-      <xsl:param name="indent" select="0"/>
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:apply-templates select="text()[normalize-space(.)]|*">
-	<xsl:with-param name="indent" select="$indent"/>
-      </xsl:apply-templates>
-      <xsl:text>&#xA;</xsl:text>
-    </xsl:template>
-
-    <!-- Process the (block) list doc elements -->
-    <xsl:template match="adr:doc//adr:list">
-      <xsl:param name="indent" select="0"/>
-      <xsl:apply-templates select="adr:item">
-	<xsl:with-param name="indent" select="$indent + 2"/>
-      </xsl:apply-templates>
-    </xsl:template>
-
-    <!-- Process the (block) list item doc elements -->
-    <xsl:template match="adr:list/adr:item">
-      <xsl:param name="indent" select="0"/>
-      <xsl:if test="$indent > 0">
-	<xsl:text>&#xA;</xsl:text>
-	<xsl:value-of select="substring($indentstr, 1, $indent)"/>
-      </xsl:if>
-      <xsl:choose>
-	<xsl:when test="parent::node()[@type ='ordered']">
-	  <xsl:number/><xsl:text>. </xsl:text>
-	  <xsl:apply-templates select="text()[normalize-space(.)]|*"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:text>* </xsl:text>
-	  <xsl:apply-templates select="text()[normalize-space(.)]|*"/>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
-
-    <!-- Process the (block) example doc elements -->
-    <xsl:template match="adr:doc//adr:example">
-      <xsl:param name="indent" select="0"/>
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:if test="$indent > 0">
-	<xsl:value-of select="substring($indentstr, 1, $indent)"/>
-      </xsl:if>
-      <xsl:value-of select="@caption"/>
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:value-of select="self::node()"/>
-    </xsl:template>
-
-</xsl:stylesheet>
--- a/usr/src/java/adr/org/opensolaris/os/adr/adrgen/CGenerator.java	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/java/adr/org/opensolaris/os/adr/adrgen/CGenerator.java	Wed Mar 14 10:45:15 2012 -0400
@@ -20,16 +20,16 @@
  */
 
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
  */
 
 package org.opensolaris.os.adr.adrgen;
 
+import java.io.*;
+import java.util.*;
 import org.opensolaris.os.adr.*;
-import java.io.FileNotFoundException;
-import java.io.PrintStream;
-import java.util.LinkedList;
-import java.util.List;
+import org.opensolaris.os.adr.CLI.Option;
+import org.opensolaris.os.adr.Type.*;
 
 public class CGenerator {
 
@@ -193,13 +193,14 @@
 	impl.println();
     }
 
-    static void generate(ADRGen p, boolean server, boolean stubs,
+    static void generate(ADRGen p, String outDir, boolean server, boolean stubs,
 	boolean common) throws FileNotFoundException {
 
 	Interface iface = p.iface_;
 	String header_name = "api_" + p.basename_ + ".h";
-	PrintStream o_header = new PrintStream(header_name);
-	PrintStream o_impl = new PrintStream("api_" + p.basename_ + "_impl.c");
+	PrintStream o_header = new PrintStream(new File(outDir, header_name));
+	PrintStream o_impl = new PrintStream(
+	    new File(outDir, "api_" + p.basename_ + "_impl.c"));
 
 	for (Type.BuiltinType t : Type.BUILTINS.values())
 	    setTargetName(t, t.getType().toString().toLowerCase());
@@ -273,7 +274,7 @@
 
 	/* XXX: need to require api/feature names be "tame". */
 	/* XXX: Should keep readers/writers/invokers sorted */
-	for (API api : iface.getAPIs()) {
+	for (API api : iface.getAPIs().values()) {
 	    List<String> myinvokers = new LinkedList<String>();
 	    List<String> myreaders = new LinkedList<String>();
 	    List<String> mywriters = new LinkedList<String>();
@@ -511,8 +512,8 @@
 	if (!stubs)
 	    return;
 
-	PrintStream o_stubs =
-	    new PrintStream("api_" + p.basename_ + "_stubs.c");
+	PrintStream o_stubs = new PrintStream(
+	    new File(outDir, "api_" + p.basename_ + "_stubs.c"));
 	o_stubs.format("#include <stdio.h>\n");
 	o_stubs.format("#include <rad/adr.h>\n\n");
 	o_stubs.format("#include <rad/adr_object.h>\n\n");
@@ -560,4 +561,42 @@
 	    o_stubs.format("}\n\n");
 	}
     }
+
+    /**
+     * Performs intrinsic validation of the given spec file, then generates C
+     * definitions.  Note: this method does NOT validate against a schema.
+     *
+     * Usage: java ... -d <dir> [-N] [-r [-m] [-s]] <spec.xml>
+     */
+    public static void main(String[] args) {
+	CLI cli = new CLI(CGenerator.class);
+	Map<Character, CLI.Option> opts = new HashMap<Character, CLI.Option>();
+	int operands = cli.getOptions(args, "d:Nrms", opts);
+	if (operands == args.length) {
+	    cli.die(2, "spec file not specified");
+	}
+
+	File file = new File(args[operands]);
+	CLI.Option d = opts.get('d');
+	if (d == null) {
+	    cli.die(2, "directory not specified");
+	}
+
+	String outDir = d.getArg();
+	boolean check_nullable = opts.get('N') == null;
+	boolean generate_server = opts.get('r') != null;
+	boolean generate_common = opts.get('m') != null;
+	boolean generate_cstubs = opts.get('s') != null;
+	try {
+	    ADRGen adr = new ADRGen(file, check_nullable);
+	    CGenerator.generate(adr, outDir, generate_server, generate_cstubs,
+		generate_common);
+	} catch (ParseException e) {
+	    cli.die(1, "error parsing file %s: %s", file,
+		e.getLocalizedMessage());
+	} catch (FileNotFoundException e) {
+	    cli.die(1, "error parsing file %s: %s", file,
+		e.getLocalizedMessage());
+	}
+    }
 }
--- a/usr/src/java/adr/org/opensolaris/os/adr/adrgen/DocGenerator.java	Wed Mar 14 04:47:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- */
-
-package org.opensolaris.os.adr.adrgen;
-
-import org.opensolaris.os.adr.*;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import org.w3c.dom.Document;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-
-public class DocGenerator {
-
-    enum Format { NONE, TEXT, DOCBOOK };
-    private static final String RMFMT = "ADRrmdoc.xsl";
-    private static final String DBFMT = "ADRdocbook.xsl";
-    private static final String TXTFMT = "ADRtext.xsl";
-
-    static void generate(ADRGen parser, Format doc_fmt)
-	throws FileNotFoundException, TransformerException,
-	TransformerConfigurationException {
-	StreamResult output = new StreamResult(System.out);
-	String resource;
-	if (doc_fmt == Format.DOCBOOK)
-	    resource = DBFMT;
-	else if (doc_fmt == Format.TEXT)
-	    resource = TXTFMT;
-	else
-	    resource = RMFMT;
-	InputStream is = DocGenerator.class.getResourceAsStream(resource);
-	StreamSource stylesource = new StreamSource(is);
-
-	TransformerFactory tFactory = TransformerFactory.newInstance();
-	Transformer transformer = tFactory.newTransformer(stylesource);
-	DOMSource source = new DOMSource(parser.doc_);
-	transformer.transform(source, output);
-    }
-}
--- a/usr/src/java/adr/org/opensolaris/os/adr/adrgen/JGenerator.java	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/java/adr/org/opensolaris/os/adr/adrgen/JGenerator.java	Wed Mar 14 10:45:15 2012 -0400
@@ -20,19 +20,16 @@
  */
 
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
  */
 
 package org.opensolaris.os.adr.adrgen;
 
+import java.io.*;
+import java.util.*;
 import org.opensolaris.os.adr.*;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.PrintStream;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
+import org.opensolaris.os.adr.CLI.Option;
+import org.opensolaris.os.adr.Type.*;
 
 public class JGenerator {
 
@@ -373,8 +370,8 @@
 	    impl.format("\tif (check && NONDEF.contains(%s))\n",
 		fallback ? "discriminant.getValue()" : "discriminant");
 	    impl.format("\t    throw new IllegalArgumentException(\n");
-	    impl.format("\t\t\"Bad default discriminant: \" + discriminant);\n"
-		);
+	    impl.format(
+		"\t\t\"Bad default discriminant: \" + discriminant);\n");
 	} else {
 	    impl.format("    protected  %s(%s discriminant) {\n", in, disctype);
 	}
@@ -544,7 +541,7 @@
 	    generateEnum(t);
 
 	/* XXX: need to require api/feature names be "tame". */
-	for (API api : iface_.getAPIs()) {
+	for (API api : iface_.getAPIs().values()) {
 	    String mxname = upperFirst(api.getName()) + "MXBean";
 	    PrintStream out = newFile(mxname);
 	    generateVersions(out, api);
@@ -595,4 +592,39 @@
 	    out.close();
 	}
     }
+
+    /**
+     * Performs intrinsic validation of the given spec file, then generates Java
+     * definitions.  Note: this method does NOT validate against a schema.
+     *
+     * Usage: java ... -d <dir> [-N] [-i] <spec.xml>
+     */
+    public static void main(String[] args) {
+	CLI cli = new CLI(JGenerator.class);
+	Map<Character, CLI.Option> opts = new HashMap<Character, CLI.Option>();
+	int operands = cli.getOptions(args, "d:Ni", opts);
+	if (operands == args.length) {
+	    cli.die(2, "spec file not specified");
+	}
+
+	File file = new File(args[operands]);
+	CLI.Option d = opts.get('d');
+	if (d == null) {
+	    cli.die(2, "directory not specified");
+	}
+
+	String outDir = d.getArg();
+	boolean check_nullable = opts.get('N') == null;
+	boolean generate_jimpl = opts.get('i') != null;
+	try {
+	    ADRGen adr = new ADRGen(file, check_nullable);
+	    new JGenerator(adr, outDir).generate(false, generate_jimpl);
+	} catch (ParseException e) {
+	    cli.die(1, "error parsing file %s: %s", file,
+		e.getLocalizedMessage());
+	} catch (FileNotFoundException e) {
+	    cli.die(1, "error parsing file %s: %s", file,
+		e.getLocalizedMessage());
+	}
+    }
 }
--- a/usr/src/java/adr/org/opensolaris/os/adr/adrgen/RadADRGen.java	Wed Mar 14 04:47:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,276 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-package org.opensolaris.os.adr.adrgen;
-
-import org.opensolaris.os.adr.*;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.net.URL;
-import java.util.*;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.validation.SchemaFactory;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-public class RadADRGen {
-    private static final String RADADRGEN_USAGE = "Usage: radadrgen [-N]" +
-	" [-c [-r [-m][-s]]] [-j dir [-i]] [-o {docbook | text | none}]" +
-	" [-d baseline.xml] spec.xml";
-
-    static class Option {
-	private char letter_;
-	private String arg_;
-
-	Option(char letter, String arg) {
-	    letter_ = letter;
-	    arg_ = arg;
-	}
-
-	char getLetter() {
-	    return letter_;
-	}
-
-	String getArg() {
-	    return arg_;
-	}
-    }
-
-    static int getOptions(String[] args, String argspec, List<Option> opts) {
-	Map<Character, Boolean> optspecs = new HashMap<Character, Boolean>();
-
-	/* Parse argspec */
-	int length = argspec.length();
-	for (int i = 0; i < length; i++) {
-	    char l = argspec.charAt(i);
-	    boolean hasargs = i + 1 < length && argspec.charAt(i + 1) == ':';
-	    if (hasargs)
-		i++;
-	    optspecs.put(l, hasargs);
-	}
-
-	/* Parse args */
-	boolean inopt = false;
-	char pending = '\0';
-	int i;
-	for (i = 0; i < args.length; i++) {
-	    if (inopt) {
-		opts.add(new Option(pending, args[i]));
-		inopt = false;
-		continue;
-	    }
-
-	    if (args[i].charAt(0) != '-')
-		break;
-
-	    for (int j = 1; j < args[i].length(); j++) {
-		char l = args[i].charAt(j);
-		if (!optspecs.containsKey(l)) {
-		    System.err.format("Invalid option \"%c\"\n", l);
-		    System.exit(2);
-		}
-
-		if (!optspecs.get(l)) {
-		    opts.add(new Option(l, null));
-		    continue;
-		}
-
-		if (j + 1 < args[i].length()) {
-		    opts.add(new Option(l, args[i].substring(j + 1)));
-		    break;
-		}
-
-		inopt = true;
-		pending = l;
-	    }
-	}
-
-	if (inopt) {
-	    System.err.format("Option \"%c\" requires an argument\n", pending);
-	    System.exit(2);
-	}
-
-	return i;
-    }
-
-    /*
-     * -c cname -j jname -s sname
-     */
-    /**
-     * @param args the command line arguments
-     */
-    public static void main(String[] args) {
-	boolean generate_c = false;
-	boolean generate_server = false;
-	boolean generate_cstubs = false;
-	boolean generate_java = false;
-	boolean generate_jimpl = false;
-	boolean generate_diff = false;
-	boolean generate_common = false;
-	boolean check_nullable = true;
-	DocGenerator.Format doc_fmt = null;
-	String java_dir = "java";
-	String baseline = "";
-
-	List<Option> opts = new LinkedList<Option>();
-	int operands = getOptions(args, "Ncj:mrsid:o:", opts);
-	for (Option o : opts) {
-	    switch (o.getLetter()) {
-	    case 'N':
-		check_nullable = false;
-		break;
-	    case 'c':
-		generate_c = true;
-		break;
-	    case 'j':
-		generate_java = true;
-		java_dir = o.getArg();
-		break;
-	    case 'r':
-		generate_server = true;
-		break;
-	    case 's':
-		generate_cstubs = true;
-		break;
-	    case 'i':
-		generate_jimpl = true;
-		break;
-	    case 'd':
-		generate_diff = true;
-		baseline = o.getArg();
-		break;
-	    case 'm':
-		generate_common = true;
-		break;
-	    case 'o':
-		try {
-		    doc_fmt =
-			DocGenerator.Format.valueOf(o.getArg().toUpperCase());
-		} catch (IllegalArgumentException ie) {
-		    System.err.format("Invalid documentation format: %s\n",
-			o.getArg());
-		    System.err.println(RADADRGEN_USAGE);
-		    System.exit(2);
-		}
-		break;
-	    }
-	}
-
-	if (operands == args.length) {
-	    System.err.println(RADADRGEN_USAGE);
-	    System.exit(2);
-	}
-
-	DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-	factory.setNamespaceAware(true);
-	try {
-	    URL schema = ADRGen.class.getResource("adr.xsd");
-	    if (schema == null) {
-		System.err.println("Unable to find schema");
-		System.exit(1);
-	    }
-	    SchemaFactory schemafactory = SchemaFactory.newInstance(
-		XMLConstants.W3C_XML_SCHEMA_NS_URI);
-	    /* Use SchemaResourceResolver to find included/imported schemas */
-	    schemafactory.setResourceResolver(new SchemaResourceResolver());
-
-	    factory.setSchema(schemafactory.newSchema(schema));
-	} catch (SAXException e) {
-	    System.err.println("Error reading ADR schema: " + e.getMessage());
-	    System.exit(1);
-	}
-
-	DocumentBuilder builder;
-	/* Contrary to the javadoc, the default error handler just drives on */
-	ErrorHandler realHandler = new ErrorHandler() {
-	    public void warning(SAXParseException exception)
-		throws SAXException {
-		throw exception;
-	    }
-
-	    public void error(SAXParseException exception)
-		throws SAXException {
-		throw exception;
-	    }
-
-	    public void fatalError(SAXParseException exception)
-		throws SAXException {
-		throw exception;
-	    }
-	};
-
-	try {
-	    builder = factory.newDocumentBuilder();
-	    builder.setErrorHandler(realHandler);
-	} catch (ParserConfigurationException ex) {
-	    System.err.println("Initialization error");
-	    System.exit(1);
-	    return;
-	}
-
-	for (int i = operands; i < args.length; i++) {
-	    String file = args[i];
-	    try {
-		ADRGen p = new ADRGen(builder, new File(file), check_nullable);
-		if (generate_diff) {
-		    ADRGen pbaseline =
-			new ADRGen(builder, new File(baseline), check_nullable);
-		    APIDiff.diff(pbaseline.iface_.apis_, p.iface_.apis_);
-		}
-		if (generate_c)
-		    CGenerator.generate(p, generate_server, generate_cstubs,
-			generate_common);
-		if (generate_java)
-		    new JGenerator(p, java_dir).generate(false, generate_jimpl);
-		if (doc_fmt != null) {
-		    DocGenerator.generate(p, doc_fmt);
-		}
-	    } catch (ParseException e) {
-		System.err.format("Error parsing file %s: %s\n", file,
-		    e.getMessage());
-		System.exit(1);
-	    } catch (FileNotFoundException e) {
-		System.err.println(e.getMessage());
-		System.exit(1);
-	    } catch (TransformerException e) {
-		/* Display an error and continue other operations */
-		System.err.format("Error transforming file %s: %s\n", file,
-		    e.getMessage());
-		System.exit(1);
-	    }
-	    builder.reset();
-	    /*
-	     * Contrary to the javadoc, the post-reset error handler is *not*
-	     * functionally equal to the pre-reset error handler.
-	     */
-	    builder.setErrorHandler(realHandler);
-	}
-    }
-}
--- a/usr/src/java/adr/org/opensolaris/os/adr/adrgen/adr.xsd	Wed Mar 14 04:47:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,436 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
-  
-  CDDL HEADER START
-  
-   The contents of this file are subject to the terms of the
-   Common Development and Distribution License (the "License").
-   You may not use this file except in compliance with the License.
-  
-   You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-   or http://www.opensolaris.org/os/licensing.
-   See the License for the specific language governing permissions
-   and limitations under the License.
-  
-   When distributing Covered Code, include this CDDL HEADER in each
-   file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-   If applicable, add the following below this CDDL HEADER, with the
-   fields enclosed by brackets "[]" replaced with your own identifying
-   information: Portions Copyright [yyyy] [name of copyright owner]
-  
-  CDDL HEADER END
--->
-<!--
-  adr.rng: an Abstract Data Representation
-  
-  Should be broken up into two schemas, one for data and one for
-  APIs.
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.opensolaris.org/ns/adr" xmlns:adr="http://www.opensolaris.org/ns/adr">
-  <xs:include schemaLocation="ADRdoc.xsd"/>
-  <!-- We support a fixed set of built-in types. -->
-  <xs:attributeGroup name="basetype">
-    <xs:attribute name="type" use="required">
-      <xs:simpleType>
-        <xs:restriction base="xs:token">
-          <xs:enumeration value="boolean"/>
-          <xs:enumeration value="string"/>
-          <xs:enumeration value="integer"/>
-          <xs:enumeration value="long"/>
-          <xs:enumeration value="time"/>
-          <xs:enumeration value="name"/>
-          <xs:enumeration value="uinteger"/>
-          <xs:enumeration value="ulong"/>
-          <xs:enumeration value="opaque"/>
-          <xs:enumeration value="password"/>
-          <xs:enumeration value="float"/>
-          <xs:enumeration value="double"/>
-        </xs:restriction>
-      </xs:simpleType>
-    </xs:attribute>
-  </xs:attributeGroup>
-  <!--
-    An item is one of a built-in type, a reference to a defined
-    type, or a list.  The first two are defined by attributes,
-    the last by a nested, typed list element.
-  -->
-  <xs:group name="typespec">
-    <xs:sequence>
-      <xs:group minOccurs="0" ref="adr:element_list"/>
-    </xs:sequence>
-  </xs:group>
-  <xs:attributeGroup name="typespec">
-    <xs:attribute name="type">
-      <xs:simpleType>
-        <xs:restriction base="xs:token">
-          <xs:enumeration value="boolean"/>
-          <xs:enumeration value="string"/>
-          <xs:enumeration value="integer"/>
-          <xs:enumeration value="long"/>
-          <xs:enumeration value="time"/>
-          <xs:enumeration value="name"/>
-          <xs:enumeration value="uinteger"/>
-          <xs:enumeration value="ulong"/>
-          <xs:enumeration value="opaque"/>
-          <xs:enumeration value="password"/>
-          <xs:enumeration value="float"/>
-          <xs:enumeration value="double"/>
-        </xs:restriction>
-      </xs:simpleType>
-    </xs:attribute>
-    <xs:attribute name="typeref"/>
-  </xs:attributeGroup>
-  <!-- A variable-length list type. -->
-  <xs:group name="element_list">
-    <xs:sequence>
-      <xs:element name="list">
-        <xs:complexType>
-          <xs:group ref="adr:typespec"/>
-          <xs:attributeGroup ref="adr:typespec"/>
-        </xs:complexType>
-      </xs:element>
-    </xs:sequence>
-  </xs:group>
-  <!--
-    Some data is optional, i.e. it may more may not be present.
-    This only applies to certain types, though constraining which
-    types is currently beyond the scope of this schema.
-  -->
-  <xs:attributeGroup name="optdata">
-    <xs:attribute name="optional" type="xs:boolean"/>
-  </xs:attributeGroup>
-  <xs:group name="typespec-opt">
-    <xs:sequence>
-      <xs:group ref="adr:typespec"/>
-    </xs:sequence>
-  </xs:group>
-  <xs:attributeGroup name="typespec-opt">
-    <xs:attributeGroup ref="adr:optdata"/>
-    <xs:attributeGroup ref="adr:typespec"/>
-  </xs:attributeGroup>
-  <xs:complexType name="typespec-arm">
-    <xs:group minOccurs="0" ref="adr:typespec-opt"/>
-    <xs:attribute name="type">
-      <xs:simpleType>
-        <xs:restriction base="xs:token">
-          <xs:enumeration value="void"/>
-          <xs:enumeration value="boolean"/>
-          <xs:enumeration value="string"/>
-          <xs:enumeration value="integer"/>
-          <xs:enumeration value="long"/>
-          <xs:enumeration value="time"/>
-          <xs:enumeration value="name"/>
-          <xs:enumeration value="uinteger"/>
-          <xs:enumeration value="ulong"/>
-          <xs:enumeration value="opaque"/>
-          <xs:enumeration value="password"/>
-          <xs:enumeration value="float"/>
-          <xs:enumeration value="double"/>
-        </xs:restriction>
-      </xs:simpleType>
-    </xs:attribute>
-    <xs:attributeGroup ref="adr:optdata"/>
-    <xs:attribute name="typeref"/>
-  </xs:complexType>
-  <!--
-    Permit a structure type to include another structure type.
-    This is largely syntactic sugar, though it could be exploited
-    in target languages that support inheritance relationships.
-  -->
-  <xs:element name="include">
-    <xs:complexType>
-      <xs:attribute name="typeref" use="required"/>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="field">
-    <xs:complexType>
-      <xs:complexContent>
-        <xs:extension base="adr:doc-optional">
-          <xs:group ref="adr:typespec-opt"/>
-          <xs:attribute name="name" use="required"/>
-          <xs:attributeGroup ref="adr:typespec-opt"/>
-        </xs:extension>
-      </xs:complexContent>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="type">
-    <xs:complexType>
-      <xs:complexContent>
-        <xs:extension base="adr:doc-optional">
-          <xs:choice>
-            <xs:sequence>
-              <xs:element maxOccurs="unbounded" ref="adr:include"/>
-              <xs:element minOccurs="0" maxOccurs="unbounded" ref="adr:field"/>
-            </xs:sequence>
-            <xs:element maxOccurs="unbounded" ref="adr:field"/>
-          </xs:choice>
-          <xs:attribute name="name" use="required"/>
-        </xs:extension>
-      </xs:complexContent>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="arm">
-    <xs:complexType>
-      <xs:complexContent>
-        <xs:extension base="adr:typespec-arm">
-          <xs:attribute name="value" use="required"/>
-        </xs:extension>
-      </xs:complexContent>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="default" type="adr:typespec-arm"/>
-  <xs:element name="union">
-    <xs:complexType>
-      <xs:complexContent>
-        <xs:extension base="adr:doc-optional">
-          <xs:sequence>
-            <xs:element maxOccurs="unbounded" ref="adr:arm"/>
-            <xs:element minOccurs="0" ref="adr:default"/>
-          </xs:sequence>
-          <xs:attribute name="name" use="required"/>
-          <xs:attribute name="type">
-            <xs:simpleType>
-              <xs:restriction base="xs:token">
-                <xs:enumeration value="boolean"/>
-              </xs:restriction>
-            </xs:simpleType>
-          </xs:attribute>
-          <xs:attribute name="typeref"/>
-        </xs:extension>
-      </xs:complexContent>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="value">
-    <xs:complexType>
-      <xs:complexContent>
-        <xs:extension base="adr:doc-optional">
-          <xs:attribute name="name" use="required"/>
-          <xs:attribute name="value"/>
-        </xs:extension>
-      </xs:complexContent>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="fallback">
-    <xs:complexType>
-      <xs:complexContent>
-        <xs:extension base="adr:doc-optional">
-          <xs:attribute name="name" use="required"/>
-        </xs:extension>
-      </xs:complexContent>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="enum">
-    <xs:complexType>
-      <xs:complexContent>
-        <xs:extension base="adr:doc-optional">
-          <xs:sequence>
-            <xs:element maxOccurs="unbounded" ref="adr:value"/>
-            <xs:element minOccurs="0" ref="adr:fallback"/>
-          </xs:sequence>
-          <xs:attribute name="name" use="required"/>
-        </xs:extension>
-      </xs:complexContent>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="pragma">
-    <xs:complexType>
-      <xs:attribute name="domain" use="required"/>
-      <xs:attribute name="name" use="required"/>
-      <xs:attribute name="value" use="required"/>
-    </xs:complexType>
-  </xs:element>
-  <xs:group name="optional_error">
-    <xs:sequence>
-      <xs:element minOccurs="0" name="error">
-        <xs:complexType>
-          <xs:complexContent>
-            <xs:extension base="adr:doc-optional">
-              <xs:attributeGroup ref="adr:optdata"/>
-              <xs:attribute name="typeref"/>
-            </xs:extension>
-          </xs:complexContent>
-        </xs:complexType>
-      </xs:element>
-    </xs:sequence>
-  </xs:group>
-  <xs:group name="property_error">
-    <xs:sequence>
-      <xs:element name="error">
-        <xs:complexType>
-          <xs:complexContent>
-            <xs:extension base="adr:doc-optional">
-              <xs:attributeGroup ref="adr:optdata"/>
-              <xs:attribute name="typeref"/>
-              <xs:attribute name="for">
-                <xs:simpleType>
-                  <xs:restriction base="xs:token">
-                    <xs:enumeration value="ro"/>
-                    <xs:enumeration value="rw"/>
-                    <xs:enumeration value="wo"/>
-                  </xs:restriction>
-                </xs:simpleType>
-              </xs:attribute>
-            </xs:extension>
-          </xs:complexContent>
-        </xs:complexType>
-      </xs:element>
-    </xs:sequence>
-  </xs:group>
-  <xs:attributeGroup name="optional_stability">
-    <xs:attribute name="stability">
-      <xs:simpleType>
-        <xs:restriction base="xs:token">
-          <xs:enumeration value="committed"/>
-          <xs:enumeration value="uncommitted"/>
-          <xs:enumeration value="private"/>
-        </xs:restriction>
-      </xs:simpleType>
-    </xs:attribute>
-  </xs:attributeGroup>
-  <xs:element name="property">
-    <xs:complexType>
-      <xs:complexContent>
-        <xs:extension base="adr:doc-optional">
-          <xs:sequence>
-            <xs:group ref="adr:typespec-opt"/>
-            <xs:sequence minOccurs="0">
-              <xs:group ref="adr:property_error"/>
-              <xs:group minOccurs="0" ref="adr:property_error"/>
-            </xs:sequence>
-          </xs:sequence>
-          <xs:attribute name="name" use="required"/>
-          <xs:attributeGroup ref="adr:optional_stability"/>
-          <xs:attribute name="access" use="required">
-            <xs:simpleType>
-              <xs:restriction base="xs:token">
-                <xs:enumeration value="ro"/>
-                <xs:enumeration value="rw"/>
-                <xs:enumeration value="wo"/>
-              </xs:restriction>
-            </xs:simpleType>
-          </xs:attribute>
-          <xs:attributeGroup ref="adr:typespec-opt"/>
-        </xs:extension>
-      </xs:complexContent>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="method">
-    <xs:complexType>
-      <xs:complexContent>
-        <xs:extension base="adr:doc-optional">
-          <xs:sequence>
-            <xs:element minOccurs="0" ref="adr:result"/>
-            <xs:group ref="adr:optional_error"/>
-            <xs:element minOccurs="0" maxOccurs="unbounded" ref="adr:argument"/>
-          </xs:sequence>
-          <xs:attribute name="name" use="required"/>
-          <xs:attributeGroup ref="adr:optional_stability"/>
-        </xs:extension>
-      </xs:complexContent>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="result">
-    <xs:complexType>
-      <xs:complexContent>
-        <xs:extension base="adr:doc-optional">
-          <xs:group ref="adr:typespec-opt"/>
-          <xs:attributeGroup ref="adr:typespec-opt"/>
-        </xs:extension>
-      </xs:complexContent>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="argument">
-    <xs:complexType>
-      <xs:complexContent>
-        <xs:extension base="adr:doc-optional">
-          <xs:group ref="adr:typespec-opt"/>
-          <xs:attribute name="name" use="required"/>
-          <xs:attributeGroup ref="adr:typespec-opt"/>
-        </xs:extension>
-      </xs:complexContent>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="event">
-    <xs:complexType>
-      <xs:complexContent>
-        <xs:extension base="adr:doc-optional">
-          <xs:attribute name="name" use="required"/>
-          <xs:attributeGroup ref="adr:optional_stability"/>
-          <xs:attribute name="type">
-            <xs:simpleType>
-              <xs:restriction base="xs:token">
-                <xs:enumeration value="boolean"/>
-                <xs:enumeration value="string"/>
-                <xs:enumeration value="integer"/>
-                <xs:enumeration value="long"/>
-                <xs:enumeration value="time"/>
-                <xs:enumeration value="name"/>
-                <xs:enumeration value="uinteger"/>
-                <xs:enumeration value="ulong"/>
-                <xs:enumeration value="opaque"/>
-                <xs:enumeration value="password"/>
-                <xs:enumeration value="float"/>
-                <xs:enumeration value="double"/>
-              </xs:restriction>
-            </xs:simpleType>
-          </xs:attribute>
-          <xs:attribute name="typeref"/>
-        </xs:extension>
-      </xs:complexContent>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="version">
-    <xs:complexType>
-      <xs:attribute name="major" use="required" type="xs:integer"/>
-      <xs:attribute name="minor" use="required" type="xs:integer"/>
-      <xs:attribute name="stability" use="required">
-        <xs:simpleType>
-          <xs:restriction base="xs:token">
-            <xs:enumeration value="committed"/>
-            <xs:enumeration value="uncommitted"/>
-            <xs:enumeration value="private"/>
-          </xs:restriction>
-        </xs:simpleType>
-      </xs:attribute>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="api">
-    <xs:complexType>
-      <xs:complexContent>
-        <xs:extension base="adr:doc-optional">
-          <xs:sequence>
-            <xs:element minOccurs="0" maxOccurs="unbounded" ref="adr:version"/>
-            <xs:element minOccurs="0" maxOccurs="unbounded" ref="adr:include"/>
-            <xs:choice maxOccurs="unbounded">
-              <xs:element ref="adr:property"/>
-              <xs:element ref="adr:method"/>
-              <xs:element ref="adr:event"/>
-            </xs:choice>
-          </xs:sequence>
-          <xs:attribute name="name" use="required"/>
-        </xs:extension>
-      </xs:complexContent>
-    </xs:complexType>
-  </xs:element>
-  <!-- optional documentation -->
-  <xs:complexType name="doc-optional">
-    <xs:group minOccurs="0" ref="adr:documentation"/>
-  </xs:complexType>
-  <xs:element name="interface">
-    <xs:complexType>
-      <xs:complexContent>
-        <xs:extension base="adr:doc-optional">
-          <xs:choice maxOccurs="unbounded">
-            <xs:element ref="adr:pragma"/>
-            <xs:element ref="adr:type"/>
-            <xs:element ref="adr:enum"/>
-            <xs:element ref="adr:union"/>
-            <xs:element ref="adr:api"/>
-          </xs:choice>
-          <xs:attribute name="name" use="required"/>
-        </xs:extension>
-      </xs:complexContent>
-    </xs:complexType>
-  </xs:element>
-</xs:schema>
--- a/usr/src/java/adr/radadrgen.sh	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/java/adr/radadrgen.sh	Wed Mar 14 10:45:15 2012 -0400
@@ -24,5 +24,233 @@
 # Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
-ADRLOC=$(dirname $0)/../lib/rad/java/adr.jar
-exec java -classpath ${ADRLOC} org.opensolaris.os.adr.adrgen.RadADRGen "$@"
+#
+# Environment
+#
+
+basename="`basename $0`"
+usage="\
+Usage: $basename [-N] <spec.xml>
+       $basename [-N] -c <dir> [-r [-m] [-s]] <spec.xml>
+       $basename [-N] -j <dir> [-i] <spec.xml>
+       $basename [-N] -o docbook|docbook-man|man|rmdoc <spec.xml>
+       $basename -d <baseline.xml> <spec.xml>"
+
+RADADR_SCHEMA="${RADADR_SCHEMA:-/usr/share/lib/xml/rng/radadr.rng.1}"
+RADADR_XSLDIR="${RADADR_XSLDIR:-/usr/share/lib/xml/style}"
+RADADR_JARDIR="${RADADR_JARDIR:-/usr/lib/rad/java}"
+
+CAT=/usr/bin/cat
+EGREP=/usr/bin/egrep
+FIND=/usr/bin/find
+JAVA=/usr/bin/java
+MKTEMP=/usr/bin/mktemp
+RM=/usr/bin/rm
+XMLLINT=/usr/bin/xmllint
+XSLTPROC=/usr/bin/xsltproc
+
+tmpdir=
+
+#
+# Functions
+#
+
+check_dependencies () {
+    typeset dependency="$1"
+    shift
+    typeset opt
+    for opt in "$@"
+    do
+        if [ -n "${opts[$opt]}" -a -z "${opts[$dependency]}" ]
+        then
+            die "$opt requires $dependency to be specified\n\n$usage"
+        fi
+    done
+}
+
+check_exclusive () {
+    typeset found=
+    typeset opt
+    for opt in "$@"
+    do
+        if [ -n "${opts[$opt]}" ]
+        then
+            if [ -n "$found" ]
+            then
+                die "$opt cannot be specified with $found\n\n$usage"
+            fi
+            found="$opt"
+        fi
+    done
+}
+
+cleanup() {
+    if [ -n "$tmpdir" ]
+    then
+        "$RM" -rf "$tmpdir"
+    fi
+}
+
+die() {
+    test $# -gt 0 && echo "$basename: $@" >&2
+    cleanup
+    exit 1
+}
+
+runxsltproc() {
+    typeset ignorere="$1"
+    shift
+
+    # Filter out some of xsltproc's excessive noisiness in a way that preserves
+    # its stdout and stderr.  A consequence of this filtering is that ksh won't
+    # report a failure of xsltproc in $?.  So turn on pipefail, then make sure
+    # the filter exits with 0 so as not to corrupt the reporting of xsltproc's
+    # exit status.
+    set -o pipefail
+    exec 3>&1
+    ("$XSLTPROC" "$@" 1>&3) 2>&1 | ("$EGREP" -v "$ignorere"; exit 0) 1>&2
+
+    return $?
+}
+
+generate_out() {
+    # When processing locale.xsl, xsltproc will complain when optional
+    # locale-based resource files don't exist.  Since xsltproc has no way to
+    # suppress these warnings, filter them out in a way that preserves
+    # stdout and stderr.
+    #
+    # A consequence of this filtering is that ksh won't report a failure of
+    # xsltproc in $?.  So turn on pipefail, then make sure the filter exits
+    # with 0 so as not to corrupt the reporting of xsltproc's exit status.
+    runxsltproc \
+        '^warning: failed to load external entity.*strings[^/]*\.xml' \
+        --stringparam LANG "${LC_ALL:-${LANG}}" \
+        "$RADADR_XSLDIR/radadr-$1.xsl" "$specfile"
+}
+
+#
+# Main
+#
+
+docfmt=
+typeset -A opts
+set -A args
+
+while getopts :[-]c:d:ij:mNo:rs name
+do
+    opts[-$name]=-$name
+    case "$name" in
+    o)
+        case "$OPTARG" in
+        docbook|docbook-man|man|rmdoc)
+            docfmt="$OPTARG"
+        ;;
+        *) die "invalid documentation format: $OPTARG\n\n$usage" ;;
+        esac
+    ;;
+
+    :)
+        die "-$OPTARG requires an argument\n\n$usage"
+    ;;
+
+    '?')
+        die "invalid option: -$OPTARG\n\n$usage"
+    ;;
+
+    c|j)
+        args+=(-d "$OPTARG")
+    ;;
+
+    d)
+        args+=("$OPTARG")
+    ;;
+
+    i|m|N|r|s)
+        args+=(-$name)
+    ;;
+    esac
+done
+
+check_dependencies -j -i
+check_dependencies -c -r
+check_dependencies -r -m -s
+check_exclusive -c -j -d -o
+check_exclusive -d -N
+
+shift $((OPTIND - 1))
+if [ $# -eq 0 ]
+then
+    die "no spec file specified\n\n$usage"
+fi
+
+specfile="$1"
+args+=("$specfile")
+shift
+
+if [ $# -ne 0 ]
+then
+    die "$# unexpected arguments, starting with: $1\n\n$usage"
+fi
+
+# Spec validation
+err="$("$XMLLINT" --noout --relaxng "$RADADR_SCHEMA" "$specfile" 2>&1)" || {
+    # xmllint is noisy even when validation succeeds
+    echo "$err" >&2
+    die "invalid spec file: $specfile"
+}
+
+set -A javacmd "$JAVA" -cp "$RADADR_JARDIR/adr.jar" -Dargv0="$basename"
+
+if [ -n "${opts[-c]}" ]
+then
+    "${javacmd[@]}" org.opensolaris.os.adr.adrgen.CGenerator "${args[@]}"
+
+elif [ -n "${opts[-j]}" ]
+then
+    "${javacmd[@]}" org.opensolaris.os.adr.adrgen.JGenerator "${args[@]}"
+
+elif [ -n "${opts[-d]}" ]
+then
+    "${javacmd[@]}" org.opensolaris.os.adr.APIDiff "${args[@]}"
+
+else
+    "${javacmd[@]}" org.opensolaris.os.adr.adrgen.ADRGen "${args[@]}" || die
+
+    if [ -n "${opts[-o]}" ]
+    then
+        case "$docfmt" in
+        man)
+            tmpdir="$("$MKTEMP" -dqt "$basename".XXXXXX)" ||
+                die "could not create directory: $tmpdir"
+
+            dbman="docbook-man.xml"
+            generate_out docbook-man > "$tmpdir/$dbman" || die
+
+            (
+            cd "$tmpdir"
+            runxsltproc \
+                '^WARNING: cannot add @xml:base|^Note: Writing' \
+                --xinclude \
+                --nonet \
+                --stringparam funcsynopsis.style "ansi" \
+                --stringparam man.authors.section.enabled 0 \
+                --stringparam section.autolabel 1 \
+                --stringparam section.label.includes.component.label 1 \
+                --stringparam segmentedlist.as.table 1 \
+                --stringparam profile.status "private" \
+                --param refentry.meta.get.quietly 1 \
+                http://docbook.sourceforge.net/release/xsl/current/manpages/profile-docbook.xsl \
+                "$dbman"
+            ) || die
+
+            "$FIND" "$tmpdir" -type f \( -name "$dbman" -o -exec "$CAT" {} \; \)
+        ;;
+
+        *)
+            generate_out "$docfmt" || die
+        ;;
+        esac
+    fi
+fi
+
+cleanup
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/java/adr/xml/rng/radadr-doc.rng	Wed Mar 14 10:45:15 2012 -0400
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+
+ CDDL HEADER START
+
+  The contents of this file are subject to the terms of the
+  Common Development and Distribution License (the "License").
+  You may not use this file except in compliance with the License.
+
+  You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+  or http://www.opensolaris.org/os/licensing.
+  See the License for the specific language governing permissions
+  and limitations under the License.
+
+  When distributing Covered Code, include this CDDL HEADER in each
+  file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+  If applicable, add the following below this CDDL HEADER, with the
+  fields enclosed by brackets "[]" replaced with your own identifying
+  information: Portions Copyright [yyyy] [name of copyright owner]
+
+ CDDL HEADER END
+-->
+
+<!--
+  radadr-doc.rng: ADR documentation
+-->
+
+<grammar ns="http://www.opensolaris.org/ns/adr"
+    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
+    xmlns="http://relaxng.org/ns/structure/1.0">
+
+  <!-- inline doc elements -->
+  <define name="doc-inline">
+    <choice>
+      <text />
+      <ref name="element-doc-code" />
+      <ref name="element-doc-strong" />
+      <ref name="element-doc-link" />
+      <ref name="element-doc-br" />
+    </choice>
+  </define>
+
+  <!-- block doc elements -->
+  <define name="doc-block">
+    <choice>
+      <ref name="element-doc-heading" />
+      <ref name="element-doc-para" />
+      <ref name="element-doc-list" />
+      <ref name="element-doc-example" />
+    </choice>
+  </define>
+
+  <!-- (inline) code snippet -->
+  <!-- A nested element-doc-code is not permitted. -->
+  <define name="element-doc-code">
+    <element name="code">
+      <ref name="doc-inline-content" />
+    </element>
+  </define>
+
+  <!-- (inline) strong/emphasis -->
+  <!-- A nested element-doc-strong is not permitted. -->
+  <define name="element-doc-strong">
+    <element name="strong">
+      <ref name="doc-inline-content" />
+    </element>
+  </define>
+
+  <!-- (inline) url -->
+  <!-- A nested element-doc-link is not permitted. -->
+  <define name="element-doc-link">
+    <element name="link">
+      <attribute name="url" />
+      <ref name="doc-inline-content" />
+    </element>
+  </define>
+
+  <!-- (inline) line break -->
+  <define name="element-doc-br">
+    <element name="br">
+      <empty />
+    </element>
+  </define>
+
+  <!-- (block) paragraph -->
+  <define name="element-doc-para">
+    <element name="para">
+      <ref name="doc-inline-content" />
+    </element>
+  </define>
+
+  <!-- (block) heading -->
+  <define name="element-doc-heading">
+    <element name="heading">
+      <ref name="doc-inline-content" />
+    </element>
+  </define>
+
+  <!-- (block) example (code, preformatted) -->
+  <define name="element-doc-example">
+    <element name="example">
+      <optional>
+        <attribute name="caption" />
+      </optional>
+      <text />
+    </element>
+  </define>
+
+  <!-- (block) list item -->
+  <define name="element-doc-item">
+    <element name="item">
+      <!-- For ease of processing, make this consistent with <doc> -->
+      <ref name="doc-uniform-content" />
+    </element>
+  </define>
+
+  <!-- (block) list (rudimentary - ordered, unordered) -->
+  <!-- default = unordered list -->
+  <define name="element-doc-list">
+    <element name="list">
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>unordered</value>
+            <value>ordered</value>
+          </choice>
+        </attribute>
+      </optional>
+      <oneOrMore>
+        <ref name="element-doc-item" />
+      </oneOrMore>
+    </element>
+  </define>
+
+
+  <!-- documentation attributes -->
+  <!-- language -->
+  <define name="attr-doc-lang">
+    <attribute name="lang">
+      <data type="language" />
+    </attribute>
+  </define>
+
+  <!-- documentation summary -->
+  <define name="element-doc-summary">
+    <element name="summary">
+      <optional>
+        <ref name="attr-doc-lang" />
+      </optional>
+      <ref name="doc-inline-content" />
+    </element>
+  </define>
+
+
+  <!-- documentation content -->
+  <!--
+     Whitespace in documentation content is treated as follows:
+     contiguous sequences of white space are replaced by a single
+     space and leading and trailing spaces are removed.
+     Use CDATA sections to preserve white-space.
+  -->
+
+  <!-- inline content -->
+  <!--
+     The doc-inline-content pattern contains one or more doc-inline
+     elements. However, a doc-inline element may not be nested within
+     another doc-inline element of the same type.
+  -->
+  <define name="doc-inline-content">
+    <oneOrMore>
+      <ref name="doc-inline" />
+    </oneOrMore>
+  </define>
+
+  <!-- block content -->
+  <define name="doc-block-content">
+    <oneOrMore>
+      <ref name="doc-block" />
+    </oneOrMore>
+  </define>
+
+  <!-- inline content or block content, but not both -->
+  <define name="doc-uniform-content">
+    <choice>
+      <ref name="doc-inline-content" />
+      <ref name="doc-block-content" />
+    </choice>
+  </define>
+
+  <!-- the documentation element -->
+  <define name="documentation">
+    <optional>
+      <ref name="element-doc-summary" />
+    </optional>
+    <optional>
+      <element name="doc">
+        <optional>
+          <ref name="attr-doc-lang" />
+        </optional>
+        <ref name="doc-uniform-content" />
+      </element>
+    </optional>
+  </define>
+</grammar>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/java/adr/xml/rng/radadr.rng	Wed Mar 14 10:45:15 2012 -0400
@@ -0,0 +1,387 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+
+ CDDL HEADER START
+
+  The contents of this file are subject to the terms of the
+  Common Development and Distribution License (the "License").
+  You may not use this file except in compliance with the License.
+ 
+  You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+  or http://www.opensolaris.org/os/licensing.
+  See the License for the specific language governing permissions
+  and limitations under the License.
+ 
+  When distributing Covered Code, include this CDDL HEADER in each
+  file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+  If applicable, add the following below this CDDL HEADER, with the
+  fields enclosed by brackets "[]" replaced with your own identifying
+  information: Portions Copyright [yyyy] [name of copyright owner]
+
+ CDDL HEADER END
+-->
+
+<!--
+  radadr.rng: an Abstract Data Representation
+
+  Should be broken up into two schemas, one for data and one for
+  APIs.
+-->
+
+<grammar ns="http://www.opensolaris.org/ns/adr"
+    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
+    xmlns="http://relaxng.org/ns/structure/1.0">
+
+  <include href="radadr-doc.rng" />
+
+  <!--
+    We support a fixed set of built-in types.
+  -->
+  <define name="basetype">
+    <attribute name="type">
+      <choice>
+        <value>boolean</value>
+        <value>string</value>
+        <value>integer</value>
+        <value>long</value>
+        <value>time</value>
+        <value>name</value>
+        <value>uinteger</value>
+        <value>ulong</value>
+        <value>opaque</value>
+        <value>password</value>
+        <value>float</value>
+        <value>double</value>
+      </choice>
+    </attribute>
+  </define>
+
+  <!--
+    An item is one of a built-in type, a reference to a defined
+    type, or a list.  The first two are defined by attributes,
+    the last by a nested, typed list element.
+  -->
+  <define name="typespec">
+    <choice>
+      <ref name="basetype" />
+      <attribute name="typeref" />
+      <ref name="element_list" />
+    </choice>
+  </define>
+
+  <!--
+    A variable-length list type.
+  -->
+  <define name="element_list">
+    <element name="list">
+      <ref name="typespec" />
+    </element>
+  </define>
+
+  <!--
+    Some data is optional, i.e. it may or may not be present.
+    This only applies to certain types, though constraining which
+    types is currently beyond the scope of this schema.
+  -->
+  <define name="optdata">
+    <optional>
+      <attribute name="optional">
+        <data type="boolean" />
+      </attribute>
+    </optional>
+  </define>
+
+  <define name="typespec-opt" >
+    <ref name="optdata" />
+    <ref name="typespec" />
+  </define>
+
+  <define name="typespec-arm" >
+    <ref name="doc-optional" /> 
+    <choice>
+      <attribute name="type">
+        <value>void</value>
+      </attribute>
+      <ref name="typespec-opt" />
+    </choice>
+  </define>
+
+  <!--
+    Permit a structure type to include another structure type.
+    This is largely syntactic sugar, though it could be exploited
+    in target languages that support inheritance relationships.
+  -->
+  <define name="element_include">
+    <element name="include">
+      <attribute name="typeref" />
+    </element>
+  </define>
+
+  <define name="element_field">
+    <element name="field">
+      <attribute name="name" />
+      <ref name="doc-optional" /> 
+      <ref name="typespec-opt" />
+    </element>
+  </define>
+
+  <define name="element_type">
+    <element name="type">
+      <attribute name="name" />
+      <ref name="doc-optional" />
+    <choice>
+      <!--
+        We require at least one field or include.
+        All includes must come first, though.
+        Takes care to avoid UPA rule in XSD.
+      -->
+      <group>
+        <oneOrMore>
+          <ref name="element_include" />
+        </oneOrMore>
+        <zeroOrMore>
+          <ref name="element_field" />
+        </zeroOrMore>
+      </group>
+      <oneOrMore>
+        <ref name="element_field" />
+      </oneOrMore>
+    </choice>
+    </element>
+  </define>
+
+  <define name="element_arm">
+    <element name="arm">
+      <attribute name="value" />
+      <ref name="typespec-arm" />
+    </element>
+  </define>
+
+  <define name="element_defaultarm">
+    <element name="default">
+      <ref name="typespec-arm" />
+    </element>
+  </define>
+
+  <define name="element_union">
+    <element name="union">
+      <attribute name="name" />
+      <ref name="doc-optional" />
+      <choice>
+        <attribute name="type">
+          <value>boolean</value>
+        </attribute>
+        <!-- Must be an enumeration -->
+        <attribute name="typeref" />
+      </choice>
+      <oneOrMore>
+        <ref name="element_arm" />
+      </oneOrMore>
+      <optional>
+        <ref name="element_defaultarm" />
+      </optional>
+    </element>
+  </define>
+
+  <define name="element_value">
+    <element name="value">
+      <attribute name="name" />
+      <optional>
+        <attribute name="value" />
+      </optional>
+      <ref name="doc-optional" />
+    </element>
+  </define>
+
+  <define name="element_fallback">
+    <element name="fallback">
+      <attribute name="name" />
+      <ref name="doc-optional" />
+    </element>
+  </define>
+
+  <define name="element_enum">
+    <element name="enum">
+      <attribute name="name" />
+      <ref name="doc-optional" />
+      <oneOrMore>
+        <ref name="element_value" />
+      </oneOrMore>
+      <optional>
+        <ref name="element_fallback" />
+      </optional>
+    </element>
+  </define>
+
+  <define name="element_pragma">
+    <element name="pragma">
+      <attribute name="domain" />
+      <attribute name="name" />
+      <attribute name="value" />
+    </element>
+  </define>
+
+  <define name="optional_error">
+    <optional>
+      <element name="error">
+        <ref name="optdata" />
+        <optional>
+          <attribute name="typeref" />
+        </optional>
+        <ref name="doc-optional" />
+      </element>
+    </optional>
+  </define>
+
+  <define name="property_error">
+    <element name="error">
+      <ref name="optdata"/>
+      <optional>
+        <attribute name="typeref"/>
+      </optional>
+      <optional>
+        <attribute name="for">
+          <choice>
+            <value>ro</value>
+            <value>rw</value>
+            <value>wo</value>
+          </choice>
+        </attribute>
+      </optional>
+      <ref name="doc-optional" />
+    </element>
+  </define>
+
+  <define name="optional_stability">
+    <optional>
+      <attribute name="stability">
+        <choice>
+            <value>committed</value>
+            <value>uncommitted</value>
+            <value>private</value>
+        </choice> 
+      </attribute>    
+    </optional>   
+  </define>
+
+  <define name="element_property">
+    <element name="property">
+      <attribute name="name" />
+      <ref name="optional_stability" />
+      <attribute name="access">
+        <choice>
+          <value>ro</value>
+          <value>rw</value>
+          <value>wo</value>
+        </choice>
+      </attribute>
+      <ref name="doc-optional" />
+      <ref name="typespec-opt" />
+      <optional>
+        <ref name="property_error"/>
+        <optional>
+          <ref name="property_error"/>
+        </optional>
+      </optional>
+    </element>
+  </define>
+
+  <define name="element_method">
+    <element name="method">
+      <attribute name="name" />
+      <ref name="optional_stability" />
+      <ref name="doc-optional" />
+      <optional>
+        <element name="result">
+          <ref name="doc-optional" />
+          <ref name="typespec-opt" />
+        </element>
+      </optional>
+      <ref name="optional_error" />
+      <zeroOrMore>
+        <element name="argument">
+          <attribute name="name" />
+              <ref name="doc-optional" />
+          <ref name="typespec-opt" />
+        </element>
+      </zeroOrMore>
+    </element>
+  </define>
+
+  <define name="element_event">
+    <element name="event">
+      <attribute name="name" />
+      <ref name="optional_stability" />
+      <choice>
+        <ref name="basetype" />
+        <attribute name="typeref" />
+      </choice>
+      <ref name="doc-optional" />
+    </element>
+  </define>
+
+  <define name="element_version">
+    <element name="version">
+      <attribute name="major">
+        <data type="integer" />
+      </attribute>
+      <attribute name="minor">
+        <data type="integer" />
+      </attribute>
+      <!-- micro is specified by implementation -->
+      <attribute name="stability">
+        <choice>
+            <value>committed</value>
+            <value>uncommitted</value>
+            <value>private</value>
+        </choice> 
+      </attribute>
+    </element>
+  </define>
+
+  <define name="element_api">
+    <element name="api">
+      <attribute name="name" />
+      <ref name="doc-optional" />
+      <!-- only 1 version per stability level is permitted -->
+      <zeroOrMore>
+        <ref name="element_version" />
+      </zeroOrMore>
+      <zeroOrMore>
+        <ref name="element_include" />
+      </zeroOrMore>
+      <oneOrMore>
+        <choice>
+          <ref name="element_property" />
+          <ref name="element_method" />
+          <ref name="element_event" />
+        </choice>
+      </oneOrMore>
+    </element>
+  </define>
+
+  <!-- optional documentation -->
+  <define name="doc-optional">
+    <optional>
+      <ref name="documentation" />
+    </optional>
+  </define>
+
+      <start>
+    <element name="interface">
+      <attribute name="name" />
+      <ref name="doc-optional" />
+      <oneOrMore>
+        <choice>
+          <ref name="element_pragma" />
+          <ref name="element_type" />
+          <ref name="element_enum" />
+          <ref name="element_union" />
+          <ref name="element_api" />
+        </choice>
+      </oneOrMore>
+    </element>
+  </start>
+
+</grammar>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/java/adr/xml/style/locale.xsl	Wed Mar 14 10:45:15 2012 -0400
@@ -0,0 +1,351 @@
+<?xml version="1.0"?>
+<!--
+  Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+
+  CDDL HEADER START
+
+   The contents of this file are subject to the terms of the
+   Common Development and Distribution License (the "License").
+   You may not use this file except in compliance with the License.
+
+   You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+   or http://www.opensolaris.org/os/licensing.
+   See the License for the specific language governing permissions
+   and limitations under the License.
+
+   When distributing Covered Code, include this CDDL HEADER in each
+   file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+   If applicable, add the following below this CDDL HEADER, with the
+   fields enclosed by brackets "[]" replaced with your own identifying
+   information: Portions Copyright [yyyy] [name of copyright owner]
+
+  CDDL HEADER END
+-->
+
+<!--
+  * This stylesheet provides generalized localization support for xslt
+  * stylesheets.
+  *
+  * To use:
+  *
+  * 1. Include this snippet in your stylesheet:
+  *
+  *     <xsl:import href="<path>/<to>/locale.xsl"/>
+  *     <xsl:variable name="LOCALE_PKG_PREFIX" select="'someprefix-'"/>
+  *
+  *   ...where "someprefix" is a unique prefix that identifies the package or
+  *   project containing your stylesheets.
+  *
+  * 2. Set the LANG param when processing your stylesheet.  This parameter takes
+  *    the same form as the LANG environment variable (see environ(5)):
+  *
+  *       <language>[_<territory>][.<codeset>][@<modifier>]
+  *
+  *    For example, using xsltproc:
+  *
+  *       % /usr/bin/xsltproc -stringparam LANG "${LC_ALL:-${LANG}}" ...
+  *
+  * 3. Create a resource file:
+  *
+  *     <?xml version="1.0" encoding="utf-8"?>
+  *     <resources>
+  *       <string name="my.resource.property.greeting">
+  *         Hello, {1}!  Have a good {2}!
+  *       </string>
+  *       <string name="my.resource.property.foo">
+  *         Yadda yadda
+  *       </string>
+  *       ...
+  *     </resources>
+  *
+  *   Save the resource file, relative to your stylesheet, as:
+  *
+  *     locale/${LOCALE_PKG_PREFIX}strings_<language>_<territory>@<modifier>.xml
+  *     locale/${LOCALE_PKG_PREFIX}strings_<language>_<territory>.xml
+  *     locale/${LOCALE_PKG_PREFIX}strings_<language>.xml
+  *     locale/${LOCALE_PKG_PREFIX}strings.xml
+  *
+  *   ...where <language>, <territory>, and <modifier> are pulled from the $LANG
+  *   setting above.  All such files are loaded if they exist.  Resources from
+  *   more-specifically named files are preferred if there is more than one
+  *   match.
+  *
+  * 4. From within your stylesheet, call the getString template to retrieve the
+  *    resource:
+  *
+  *     <xsl:call-template name="getString">
+  *       <xsl:with-param name="name" select="'my.resource.property.greeting'"/>
+  *       <xsl:with-param name="params">
+  *         <param>
+  *           world
+  *         </param>
+  *         <param>
+  *           <bold>day</bold>
+  *         </param>
+  *       </xsl:with-param>
+  *     </xsl:call-template>
+  *
+  *   Note that a <param> can hold any XML result tree fragment (RTF), not just
+  *   text.
+  *
+  * 5. Whitespace in each string resource is normalized (see the XSLT
+  *    normalize-space() function) by default before being parameterized and
+  *    returned by getString.  This can be overridden by setting the
+  *    preserve-space attribute to "true" or "1" in the <string> or <resources>
+  *    element of the resource file:
+  *
+  *     <?xml version="1.0" encoding="utf-8"?>
+  *     <resources>
+  *       <string name="my.resource.property.label"
+  *         preserve-space="1">Name: </string>
+  *       ...
+  *     </resources>
+  *
+  *     or:
+  *
+  *     <?xml version="1.0" encoding="utf-8"?>
+  *     <resources preserve-space="1">
+  *       <string name="my.resource.property.label">Name: </string>
+  *       <string name="my.resource.property.indent">    </string>
+  *       ...
+  *     </resources>
+  -->
+
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:exsl="http://exslt.org/common">
+
+  <!--
+   * Parse a locale string of the form:
+   * <language>[_<territory>][.<codeset>][@<modifier>]
+   * into its constituent parts.
+   *-->
+  <xsl:param name="LANG"/>
+
+  <xsl:template name="langparts" mode="locale">
+    <xsl:param name="langstr" select="$LANG"/>
+    <xsl:param name="searchchars" select="'_.@'"/>
+
+    <xsl:choose>
+      <xsl:when test="string-length($searchchars) = 0">
+        <langpart type="^">
+          <xsl:value-of select="$langstr"/>
+        </langpart>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <xsl:variable name="c"
+          select='substring($searchchars, string-length($searchchars), 1)'/>
+
+        <xsl:variable name="newlangstr">
+          <xsl:choose>
+            <xsl:when test="contains($langstr, $c)">
+              <xsl:value-of select="substring-before($langstr, $c)"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="$langstr"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+
+        <xsl:call-template name="langparts" mode="locale">
+          <xsl:with-param name="langstr" select="$newlangstr"/>
+          <xsl:with-param name="searchchars"
+            select="substring($searchchars, 1,
+            string-length($searchchars) - 1)"/>
+        </xsl:call-template>
+
+        <!-- Ignore codeset, if any -->
+        <xsl:if test="$c != '.' and contains($langstr, $c)">
+          <langpart type="{$c}">
+            <xsl:value-of select="substring-after($langstr, $c)"/>
+          </langpart>
+        </xsl:if>
+
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- This should be overridden by the stylesheets that include this file -->
+  <xsl:variable name="LOCALE_PKG_PREFIX"/>
+
+  <!--
+   * Based on the current node's <lang> element hierarchy (created in
+   * the langparts template), load and combine all existing external resource
+   * files using a ResourceBundle.getBundle-like algorithm:
+   *
+   * locale/${LOCALE_PKG_PREFIX}strings_<language>_<territory>@<modifier>.xml
+   * locale/${LOCALE_PKG_PREFIX}strings_<language>_<territory>.xml
+   * locale/${LOCALE_PKG_PREFIX}strings_<language>.xml
+   * locale/${LOCALE_PKG_PREFIX}strings.xml
+   -->
+  <xsl:template match="lang" mode="locale">
+    <xsl:param name="prefix"
+      select="concat('locale/', $LOCALE_PKG_PREFIX, 'strings')"/>
+    <xsl:param name="suffix" select="'.xml'"/>
+
+    <!-- Language -->
+    <xsl:if test="langpart[@type = '^']">
+
+      <xsl:variable name="prefix.l">
+        <xsl:value-of select="$prefix"/>
+        <xsl:text>_</xsl:text>
+        <xsl:value-of select="langpart[@type = '^']"/>
+      </xsl:variable>
+
+      <!-- Language + territory -->
+      <xsl:if test="langpart[@type = '_']">
+
+        <xsl:variable name="prefix.l.t">
+          <xsl:value-of select="$prefix.l"/>
+          <xsl:text>_</xsl:text>
+          <xsl:value-of select="langpart[@type = '_']"/>
+        </xsl:variable>
+
+        <!-- Language + territory + modifier -->
+        <xsl:if test="langpart[@type = '@']">
+          <xsl:variable name="prefix.l.t.m">
+            <xsl:value-of select="$prefix.l.t"/>
+            <xsl:text>@</xsl:text>
+            <xsl:value-of select="langpart[@type = '@']"/>
+          </xsl:variable>
+
+          <xsl:copy-of select="document(concat($prefix.l.t.m, $suffix))"/>
+        </xsl:if>
+
+        <xsl:copy-of select="document(concat($prefix.l.t, $suffix))"/>
+      </xsl:if>
+
+      <xsl:copy-of select="document(concat($prefix.l, $suffix))"/>
+    </xsl:if>
+
+    <xsl:copy-of select="document(concat($prefix, $suffix))"/>
+  </xsl:template>
+
+  <xsl:variable name="stringsrtf">
+    <!-- Disect $LANG into its constituent parts -->
+    <xsl:variable name="langparts">
+      <lang>
+        <xsl:call-template name="langparts" mode="locale"/>
+      </lang>
+    </xsl:variable>
+
+    <!--
+     * Create a node-set from the above RTF, then load appropriate external
+     * localized files
+     -->
+    <xsl:apply-templates select="exsl:node-set($langparts)/lang" mode="locale"/>
+  </xsl:variable>
+
+  <xsl:variable name="strings" select="exsl:node-set($stringsrtf)"/>
+
+  <!--
+   * Locate the given string from the resource files discovered above.
+   *
+   * Arguments:
+   *
+   * name - the name of the <string> resource
+   * params - an RTF of parameters to substitute for {N} within the found
+   * string:
+   *
+   * <param>
+   *   foo
+   * <param>
+   * <param>
+   *   bar
+   * <param>
+   * ...
+   -->
+  <xsl:template name="getString">
+    <xsl:param name="name"/>
+    <xsl:param name="params"/>
+
+    <xsl:variable name="string"
+      select="($strings/resources/string[@name = $name])[1]"/>
+
+    <!--
+     * Look for a preserve-space attribute in the <string> or its parent
+     * <resource> for guidance on whether space should be preserved.  If not
+     * found in either element, default to false.
+     *
+     * Note: XSLT 1.0 forces variables to be RTFs when using child nodes
+     * instead of the select attributes.  So add a non-empty string ("1") to
+     * preserve space, then convert it to a boolean later.
+     -->
+    <xsl:variable name="preserve-space">
+      <xsl:choose>
+        <xsl:when test="$string/@preserve-space">
+          <xsl:if test="$string/@preserve-space = 'true' or
+            $string/@preserve-space = '1'">
+            1
+          </xsl:if>
+        </xsl:when>
+        <xsl:when test="$string/../@preserve-space">
+          <xsl:if test="$string/../@preserve-space = 'true' or
+            $string/../@preserve-space = '1'">
+            1
+          </xsl:if>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="text">
+      <xsl:choose>
+        <!--
+         * Convert $preserve-space from an RTF to a string to a boolean, since
+         * RTF-to-boolean conversion of a non-empty RTF always equals true
+         -->
+        <xsl:when test="not(boolean(string($preserve-space)))">
+          <xsl:value-of select="normalize-space($string/text())"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$string/text()"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:call-template name="parameterize" mode="locale">
+      <xsl:with-param name="text" select="$text"/>
+      <xsl:with-param name="params" select="exsl:node-set($params)"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="parameterize" mode="locale">
+    <xsl:param name="text"/>
+    <xsl:param name="params"/>
+    <xsl:param name="level" select="1"/>
+
+    <xsl:choose>
+      <xsl:when test="$level > count($params/param)">
+        <xsl:value-of select="$text"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:variable name="search" select="concat('{', $level, '}')"/>
+        <xsl:choose>
+          <xsl:when test="contains($text, $search)">
+            <xsl:call-template name="parameterize" mode="locale">
+              <xsl:with-param name="text"
+                select="substring-before($text, $search)"/>
+              <xsl:with-param name="params" select="$params"/>
+              <xsl:with-param name="level" select="$level + 1"/>
+            </xsl:call-template>
+            <xsl:copy-of select="$params/param[$level]/node()"/>
+            <xsl:call-template name="parameterize" mode="locale">
+              <xsl:with-param name="text"
+                select="substring-after($text, $search)"/>
+              <xsl:with-param name="params" select="$params"/>
+              <xsl:with-param name="level" select="$level"/>
+            </xsl:call-template>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="parameterize" mode="locale">
+              <xsl:with-param name="text" select="$text"/>
+              <xsl:with-param name="params" select="$params"/>
+              <xsl:with-param name="level" select="$level + 1"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/java/adr/xml/style/locale/radadr-strings.xml	Wed Mar 14 10:45:15 2012 -0400
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  CDDL HEADER START
+
+  The contents of this file are subject to the terms of the
+  Common Development and Distribution License (the "License").
+  You may not use this file except in compliance with the License.
+
+  You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+  or http://www.opensolaris.org/os/licensing.
+  See the License for the specific language governing permissions
+  and limitations under the License.
+
+  When distributing Covered Code, include this CDDL HEADER in each
+  file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+  If applicable, add the following below this CDDL HEADER, with the
+  fields enclosed by brackets "[]" replaced with your own identifying
+  information: Portions Copyright [yyyy] [name of copyright owner]
+
+  CDDL HEADER END
+
+  Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+-->
+
+<!-- String resources for the radadrgen docbook stylesheets -->
+<resources>
+  <!-- General -->
+  <string name="docbook.general.voidtype">
+    (no type)
+  </string>
+  <string name="docbook.general.optional">
+    optional
+  </string>
+
+  <!-- man -->
+  <string name="docbook.man.refmiscinfo">
+    RAD Module Definitions
+  </string>
+  <string name="docbook.man.section.description">
+    Description
+  </string>
+
+  <!-- interface -->
+  <string name='docbook.interface.title'>
+    Interface Documentation: {1}
+  </string>
+  <string name='docbook.interface.label'>
+    interface {1}
+  </string>
+
+  <!-- api -->
+  <string name="docbook.api.title">
+    APIs
+  </string>
+  <string name="docbook.api.label">
+    api {1}
+  </string>
+  <string name="docbook.api.inheritance.title">
+    Inheritance Hierarchy
+  </string>
+  <string name="docbook.api.version.header">
+    Version:
+  </string>
+  <string name="docbook.api.property.header">
+    {1} Properties
+  </string>
+  <string name="docbook.api.property.ro">
+    read-only
+  </string>
+  <string name="docbook.api.property.wo">
+    write-only
+  </string>
+  <string name="docbook.api.property.rw">
+    read-write
+  </string>
+  <string name="docbook.api.property.error.header.ro">
+    Read Error:
+  </string>
+  <string name="docbook.api.property.error.header.wo">
+    Write Error:
+  </string>
+  <string name="docbook.api.property.error.header.rw">
+    Read-Write Error:
+  </string>
+  <string name='docbook.api.property.inherited.header'>
+    Inherited Properties ({1}):
+  </string>
+  <string name='docbook.api.property.inherited.none'>
+    (none)
+  </string>
+  <string name="docbook.api.method.header">
+    {1} Methods
+  </string>
+  <string name="docbook.api.method.argument.header">
+    Arguments:
+  </string>
+  <string name="docbook.api.method.result.header">
+    Result:
+  </string>
+  <string name="docbook.api.method.error.header">
+    Error:
+  </string>
+  <string name='docbook.api.method.inherited.header'>
+    Inherited Methods ({1}):
+  </string>
+  <string name='docbook.api.method.inherited.none'>
+    (none)
+  </string>
+  <string name="docbook.api.event.header">
+    {1} Events
+  </string>
+
+  <!-- enum -->
+  <string name="docbook.enum.title">
+    Enumerated Types
+  </string>
+  <string name="docbook.enum.label">
+    enum {1}
+  </string>
+  <string name="docbook.enum.value">
+    <!-- name, value -->
+    {1} ({2})
+  </string>
+  <string name="docbook.enum.fallback">
+    fallback: {1}
+  </string>
+
+  <!-- type -->
+  <string name="docbook.type.title">
+    Structure Types
+  </string>
+  <string name="docbook.type.label">
+    type {1}
+  </string>
+  <string name="docbook.type.field.header">
+    Fields:
+  </string>
+  <string name="docbook.type.inheritance.title">
+    Inheritance Hierarchy
+  </string>
+  <string name='docbook.type.field.inherited.header'>
+    Inherited Fields ({1}):
+  </string>
+  <string name='docbook.type.field.inherited.none'>
+    (none)
+  </string>
+
+  <!-- union -->
+  <string name="docbook.union.title">
+    Union Types
+  </string>
+  <string name="docbook.union.label">
+    union {1}
+  </string>
+  <string name="docbook.union.arm.label">
+    <!-- value, type -->
+    case {1}: {2}
+  </string>
+  <string name="docbook.union.default.label">
+    default: {1}
+  </string>
+</resources>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/java/adr/xml/style/radadr-docbook-common.xsl	Wed Mar 14 10:45:15 2012 -0400
@@ -0,0 +1,1168 @@
+<?xml version="1.0"?>
+<!--
+  Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+
+  CDDL HEADER START
+
+   The contents of this file are subject to the terms of the
+   Common Development and Distribution License (the "License").
+   You may not use this file except in compliance with the License.
+
+   You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+   or http://www.opensolaris.org/os/licensing.
+   See the License for the specific language governing permissions
+   and limitations under the License.
+
+   When distributing Covered Code, include this CDDL HEADER in each
+   file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+   If applicable, add the following below this CDDL HEADER, with the
+   fields enclosed by brackets "[]" replaced with your own identifying
+   information: Portions Copyright [yyyy] [name of copyright owner]
+
+  CDDL HEADER END
+-->
+
+<!-- Common docbook xsl templates -->
+<xsl:stylesheet version="1.0"
+  xmlns:adr="http://www.opensolaris.org/ns/adr"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  exclude-result-prefixes="adr">
+
+  <!-- l10n routines -->
+  <xsl:import href="locale.xsl"/>
+  <xsl:variable name="LOCALE_PKG_PREFIX" select="'radadr-'"/>
+
+  <!--
+   * Whether to adhere to the docbook schema, at the expense of some elements
+   * not rendering as nicely
+   -->
+  <xsl:param name="transform.adheretoschema" select="0"/>
+
+  <!-- The element name of sections at various depths -->
+  <xsl:variable name="element.section1">section</xsl:variable>
+  <xsl:variable name="element.section2">section</xsl:variable>
+  <xsl:variable name="element.section3">section</xsl:variable>
+
+  <!-- Constants -->
+  <xsl:variable name="newline"><xsl:text>&#xA;</xsl:text></xsl:variable>
+  <xsl:variable name="nbsp"><xsl:text>&#xA0;</xsl:text></xsl:variable>
+
+  <xsl:template name="header">
+    <xsl:param name="node"/>
+    <xsl:param name="inline"/>
+    <xsl:choose>
+      <xsl:when test="boolean($inline)">
+        <emphasis role="strong">
+          <xsl:copy-of select="$node"/>
+        </emphasis>
+      </xsl:when>
+      <xsl:otherwise>
+        <para>
+          <xsl:call-template name="header">
+            <xsl:with-param name="node" select="$node"/>
+            <xsl:with-param name="inline" select="1"/>
+          </xsl:call-template>
+        </para>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Indent content -->
+  <xsl:template name="indent">
+    <xsl:param name="content"/>
+
+    <xsl:choose>
+      <xsl:when test="boolean($transform.adheretoschema)">
+        <blockquote>
+          <xsl:copy-of select="$content"/>
+        </blockquote>
+      </xsl:when>
+      <xsl:otherwise>
+        <!--
+         * looks better under yelp, and renders consistently for man pages
+         * transforms, but is non-compliant
+         -->
+        <simplelist type="vert">
+          <member>
+            <xsl:copy-of select="$content"/>
+          </member>
+        </simplelist>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Indent content -->
+  <xsl:template match="*" mode="indent">
+    <xsl:call-template name="indent">
+      <xsl:with-param name="content">
+        <xsl:apply-templates select="."/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- Process type/typeref attributes for fields, props, etc. -->
+  <xsl:template match="*" mode="type">
+    <xsl:param name="enclose" select="1"/>
+    <xsl:variable name="type">
+      <xsl:choose>
+        <xsl:when test="@type">
+          <xsl:value-of select="@type"/>
+        </xsl:when>
+        <xsl:when test="@typeref">
+          <xsl:variable name="content">
+            <link linkend="{@typeref}">
+              <xsl:value-of select="@typeref"/>
+            </link>
+          </xsl:variable>
+          <xsl:choose>
+            <xsl:when test="boolean($transform.adheretoschema)">
+              <replaceable>
+                <xsl:copy-of select="$content"/>
+              </replaceable>
+            </xsl:when>
+            <xsl:otherwise>
+              <!-- looks better under yelp, but is non-compliant -->
+              <xsl:copy-of select="$content"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+        <xsl:when test="adr:list">
+          <xsl:apply-templates select="adr:list" mode="type">
+            <xsl:with-param name="enclose" select="0"/>
+          </xsl:apply-templates>
+          <xsl:text>[]</xsl:text>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="boolean($enclose)">
+        <xsl:choose>
+          <xsl:when test="string-length($type) != 0">
+            <type>
+              <xsl:copy-of select="$type"/>
+            </type>
+          </xsl:when>
+          <xsl:otherwise>
+            <emphasis>
+              <xsl:call-template name="getString">
+                <xsl:with-param name="name"
+                  select="'docbook.general.voidtype'"/>
+              </xsl:call-template>
+            </emphasis>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:copy-of select="$type"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Process parameter names -->
+  <xsl:template match="*" mode="paramname">
+    <xsl:param name="strong"/>
+    <emphasis>
+      <xsl:if test="boolean($strong)">
+        <xsl:attribute name="role">strong</xsl:attribute>
+      </xsl:if>
+      <xsl:value-of select="@name"/>
+    </emphasis>
+  </xsl:template>
+
+  <!-- Process parameters -->
+  <xsl:template match="*" mode="parameter">
+    <xsl:param name="strong"/>
+    <xsl:apply-templates select="." mode="type"/>
+    <xsl:value-of select="$nbsp"/>
+    <xsl:apply-templates select="." mode="paramname">
+      <xsl:with-param name="strong" select="$strong"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <!-- Process optional attribute for fields, props, etc. -->
+  <xsl:template match="*" mode="optional">
+    <xsl:if test="@optional = 'true' or @optional = '1'">
+      <xsl:text> (</xsl:text>
+        <emphasis>
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name" select="'docbook.general.optional'"/>
+          </xsl:call-template>
+        </emphasis>
+      <xsl:text>)</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- API hierarchy characters -->
+  <xsl:variable name="hierarchy.boxdr">.</xsl:variable>
+  <xsl:variable name="hierarchy.boxh">-</xsl:variable>
+  <xsl:variable name="hierarchy.boxv">|</xsl:variable>
+  <xsl:variable name="hierarchy.boxvr">+</xsl:variable>
+  <xsl:variable name="hierarchy.rarr">&gt;</xsl:variable>
+
+  <!--
+   * Output an inheritance tree for the given api or type.  Since these elements
+   * support multiple inheritance, the tree must be drawn slightly differently
+   * than, say, a Javadoc class hierarchy.
+   *
+   *  .-> api threeletterwords
+   *  |
+   *  |   .-> api familymember
+   *  |   |
+   *  +-> api pet
+   *  |
+   *  |       .-> api lifeform
+   *  |       |
+   *  |   .-> api animal
+   *  |   |
+   *  +-> api mammal
+   *  |
+   *  api dog
+   -->
+  <xsl:template match="adr:api|adr:type" mode="hierarchy">
+    <xsl:param name="prefix"/>
+    <xsl:param name="position" select='0'/>
+
+    <xsl:variable name="elementname" select="name()"/>
+    <xsl:variable name="newprefix">
+      <xsl:value-of select="$prefix"/>
+      <xsl:choose>
+        <xsl:when test="$position = 0"/>
+        <xsl:when test="$position = 1">
+          <xsl:text>    </xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$hierarchy.boxv"/>
+          <xsl:text>   </xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:for-each select="adr:include/@typeref">
+      <xsl:apply-templates
+        select="//*[name() = $elementname and @name = current()]"
+        mode="hierarchy">
+        <xsl:with-param name="position" select="position()"/>
+        <xsl:with-param name="prefix" select="$newprefix"/>
+      </xsl:apply-templates>
+
+      <!-- Vertical separator between nodes -->
+      <xsl:value-of select="$newline"/>
+      <xsl:value-of select="$newprefix"/>
+      <xsl:value-of select="$hierarchy.boxv"/>
+      <xsl:value-of select="$newline"/>
+    </xsl:for-each>
+
+    <xsl:value-of select="$prefix"/>
+    <xsl:if test="$position != 0">
+      <xsl:choose>
+        <xsl:when test="$position = 1">
+          <!-- Corner -->
+          <xsl:value-of select="$hierarchy.boxdr"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <!-- Tee -->
+          <xsl:value-of select="$hierarchy.boxvr"/>
+        </xsl:otherwise>
+      </xsl:choose>
+
+      <!-- Horizontal line/arrow -->
+      <xsl:value-of select="$hierarchy.boxh"/>
+      <xsl:value-of select="$hierarchy.rarr"/>
+      <xsl:text> </xsl:text>
+    </xsl:if>
+
+    <!-- Display node -->
+    <xsl:apply-templates select="." mode="hierarchy-node">
+        <xsl:with-param name="position" select="$position"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <!-- Default presentation of hierarchy nodes -->
+  <xsl:template match="adr:api" mode="hierarchy-node">
+    <xsl:param name="position"/>
+    <xsl:choose>
+      <xsl:when test="$position = 0">
+        <emphasis role="strong">
+          <xsl:apply-templates select="." mode="label"/>
+        </emphasis>
+      </xsl:when>
+      <xsl:otherwise>
+        <link linkend="{concat('api.', @name)}">
+          <xsl:apply-templates select="." mode="label"/>
+        </link>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Default presentation of hierarchy nodes -->
+  <xsl:template match="adr:type" mode="hierarchy-node">
+    <xsl:param name="position"/>
+    <xsl:variable name="text">
+      <xsl:call-template name="getString">
+        <xsl:with-param name="name" select="'docbook.type.label'"/>
+        <xsl:with-param name="params">
+          <param>
+            <xsl:value-of select="@name"/>
+          </param>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$position = 0">
+        <emphasis role="strong">
+          <xsl:value-of select="$text"/>
+        </emphasis>
+      </xsl:when>
+      <xsl:otherwise>
+        <link linkend="{@name}">
+          <xsl:value-of select="$text"/>
+        </link>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!--
+   * Output sections listing the members (fields of types, properties of
+   * apis, methods of apis, etc.) of inherited entities.  Each member is
+   * hyperlinked to the actual definition of that member elsewhere in the
+   * document.  When no members of the given type are found, the noneRes
+   * resource is used to display a "none" label.
+   -->
+  <xsl:template match="adr:api|adr:type" mode="member-hierarchy">
+    <xsl:param name="level" select='0'/>
+    <xsl:param name="member"/>
+    <xsl:param name="noneRes"/>
+
+    <xsl:variable name="elementname" select="name()"/>
+
+    <xsl:for-each select="adr:include/@typeref">
+      <xsl:apply-templates
+        select="//*[name() = $elementname and @name = current()]"
+        mode="member-hierarchy">
+        <xsl:with-param name="level" select="$level + 1"/>
+        <xsl:with-param name="member" select="$member"/>
+        <xsl:with-param name="noneRes" select="$noneRes"/>
+      </xsl:apply-templates>
+    </xsl:for-each>
+
+    <xsl:if test="$level != 0">
+      <xsl:apply-templates select="." mode="member-hierarchy-header">
+        <xsl:with-param name="member" select="$member"/>
+      </xsl:apply-templates>
+      <para>
+        <xsl:choose>
+          <xsl:when test="*[name() = $member]">
+            <simplelist type="inline">
+              <xsl:for-each select="*[name() = $member]">
+                <member>
+                  <xsl:apply-templates select="."
+                    mode="member-hierarchy-list-item"/>
+                </member>
+              </xsl:for-each>
+            </simplelist>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="getString">
+              <xsl:with-param name="name" select="$noneRes"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
+      </para>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Present an api header to appear in a member hierarchy section -->
+  <xsl:template match="adr:api" mode="member-hierarchy-header">
+    <xsl:param name="member"/>
+    <xsl:call-template name="header">
+      <xsl:with-param name="node">
+        <xsl:call-template name="getString">
+          <xsl:with-param name="name"
+            select="concat('docbook.api.', $member, '.inherited.header')"/>
+          <xsl:with-param name="params">
+            <param>
+              <xsl:value-of select="@name"/>
+            </param>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- Present a type header to appear in a member hierarchy section -->
+  <xsl:template match="adr:type" mode="member-hierarchy-header">
+    <xsl:param name="member"/>
+    <xsl:call-template name="header">
+      <xsl:with-param name="node">
+        <xsl:call-template name="getString">
+          <xsl:with-param name="name"
+            select="'docbook.type.field.inherited.header'"/>
+          <xsl:with-param name="params">
+            <param>
+              <xsl:value-of select="@name"/>
+            </param>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- Display a member in a member hierarchy section -->
+  <xsl:template match="adr:field|adr:property|adr:method"
+    mode="member-hierarchy-list-item">
+    <link linkend="{concat(../@name, '.', @name)}">
+      <emphasis>
+        <xsl:value-of select="@name"/>
+      </emphasis>
+    </link>
+  </xsl:template>
+
+  <!-- Process the documentation summary (inline) elements -->
+  <xsl:template match="adr:summary" mode="inline">
+    <xsl:param name="usehyphen" select='1'/>
+    <xsl:if test="$usehyphen">
+      <xsl:text> &#x2014; </xsl:text> <!-- &mdash; -->
+    </xsl:if>
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- Process the documentation summary (block) elements -->
+  <xsl:template match="adr:summary" mode="block">
+    <para>
+      <xsl:apply-templates/>
+    </para>
+  </xsl:template>
+
+  <!--
+   * Process "documentation root" elements, i.e. those that can contain inline
+   * children or block children, but not both.  Currently doc and item are the
+   * only such elements.
+   -->
+  <xsl:template match="adr:doc|adr:item" mode="docroot">
+    <xsl:choose>
+      <xsl:when test="adr:heading or adr:list or adr:para or adr:example">
+        <!-- Block children -->
+        <xsl:apply-templates/>
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- Inline children, wrap in a para for docbook conformance -->
+        <para>
+          <xsl:apply-templates/>
+        </para>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Process the documentation elements -->
+  <xsl:template match="adr:doc">
+    <xsl:apply-templates select="." mode="docroot"/>
+  </xsl:template>
+
+  <!-- Process the (inline) code doc elements -->
+  <xsl:template match="adr:summary//adr:code|adr:doc//adr:code">
+    <code>
+      <xsl:apply-templates/>
+    </code>
+  </xsl:template>
+
+  <!-- Process the (inline) strong doc elements -->
+  <xsl:template match="adr:summary//adr:strong|adr:doc//adr:strong">
+    <emphasis role="strong">
+      <xsl:apply-templates/>
+    </emphasis>
+  </xsl:template>
+
+  <!-- Process the (inline) link doc elements -->
+  <xsl:template match="adr:summary//adr:link|adr:doc//adr:link">
+    <ulink url="{@url}">
+      <xsl:apply-templates/>
+    </ulink>
+  </xsl:template>
+
+  <!-- Process the (inline) br doc elements -->
+  <xsl:template match="adr:summary//adr:br|adr:doc//adr:br">
+    <xsl:value-of select="$newline"/>
+  </xsl:template>
+
+  <!-- Process the (block) heading doc elements -->
+  <xsl:template match="adr:doc//adr:heading">
+    <formalpara>
+      <title>
+        <xsl:apply-templates/>
+      </title>
+      <para/>
+    </formalpara>
+  </xsl:template>
+
+  <!-- Process the (block) para doc elements -->
+  <xsl:template match="adr:doc//adr:para">
+    <para>
+      <xsl:apply-templates/>
+    </para>
+  </xsl:template>
+
+  <!-- Process the (block) list doc elements -->
+  <xsl:template match="adr:doc//adr:list">
+    <xsl:choose>
+      <xsl:when test="@type = 'ordered'">
+        <orderedlist inheritnum="ignore" continuation="restarts">
+          <xsl:apply-templates select="adr:item"/>
+        </orderedlist>
+      </xsl:when>
+      <xsl:otherwise> <!-- default: unordered -->
+        <itemizedlist>
+          <xsl:apply-templates select="adr:item"/>
+        </itemizedlist>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Process the (block) list item doc elements -->
+  <xsl:template match="adr:doc//adr:list/adr:item">
+    <listitem>
+      <xsl:apply-templates select="." mode="docroot"/>
+    </listitem>
+  </xsl:template>
+
+  <!-- Process the (block) example doc elements -->
+  <xsl:template match="adr:doc//adr:example">
+    <example>
+      <title>
+        <xsl:value-of select="@caption"/>
+      </title>
+      <programlisting format="linespecific">
+        <xsl:value-of select="."/>
+      </programlisting>
+    </example>
+  </xsl:template>
+
+  <!-- Process the interface element -->
+  <xsl:template match="adr:interface" mode="children">
+
+    <!-- Process the api elements, if any -->
+    <xsl:if test="adr:api">
+      <xsl:element name="{$element.section1}">
+        <xsl:attribute name="role">
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name" select="'docbook.api.title'"/>
+          </xsl:call-template>
+        </xsl:attribute>
+        <title>
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name" select="'docbook.api.title'"/>
+          </xsl:call-template>
+        </title>
+        <xsl:apply-templates select="adr:api"/>
+      </xsl:element>
+    </xsl:if>
+
+    <!-- Process the enum elements, if any -->
+    <xsl:if test="adr:enum">
+      <xsl:element name="{$element.section1}">
+        <xsl:attribute name="role">
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name" select="'docbook.enum.title'"/>
+          </xsl:call-template>
+        </xsl:attribute>
+        <title>
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name" select="'docbook.enum.title'"/>
+          </xsl:call-template>
+        </title>
+        <xsl:apply-templates select="adr:enum"/>
+      </xsl:element>
+    </xsl:if>
+
+    <!-- Process the type elements, if any -->
+    <xsl:if test="adr:type">
+      <xsl:element name="{$element.section1}">
+        <xsl:attribute name="role">
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name" select="'docbook.type.title'"/>
+          </xsl:call-template>
+        </xsl:attribute>
+        <title>
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name" select="'docbook.type.title'"/>
+          </xsl:call-template>
+        </title>
+        <xsl:apply-templates select="adr:type"/>
+      </xsl:element>
+    </xsl:if>
+
+    <!-- Process the union elements, if any -->
+    <xsl:if test="adr:union">
+      <xsl:element name="{$element.section1}">
+        <xsl:attribute name="role">
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name" select="'docbook.union.title'"/>
+          </xsl:call-template>
+        </xsl:attribute>
+        <title>
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name" select="'docbook.union.title'"/>
+          </xsl:call-template>
+        </title>
+        <xsl:apply-templates select="adr:union"/>
+      </xsl:element>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="adr:api" mode="label">
+    <xsl:call-template name="getString">
+      <xsl:with-param name="name" select="'docbook.api.label'"/>
+      <xsl:with-param name="params">
+        <param>
+          <xsl:value-of select="@name"/>
+        </param>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- Process the api elements -->
+  <xsl:template match="adr:api">
+    <xsl:element name="{$element.section2}">
+      <title id="{concat('api.', @name)}">
+        <xsl:apply-templates select="." mode="label"/>
+      </title>
+
+      <para>
+        <xsl:apply-templates select="adr:summary" mode="inline">
+          <xsl:with-param name="usehyphen" select="0"/>
+        </xsl:apply-templates>
+      </para>
+
+      <xsl:if test="adr:include">
+        <formalpara>
+          <title>
+            <xsl:call-template name="getString">
+              <xsl:with-param name="name"
+                select="'docbook.api.inheritance.title'"/>
+            </xsl:call-template>
+          </title>
+          <para>
+            <programlisting format="linespecific">
+              <xsl:apply-templates select="." mode="hierarchy"/>
+            </programlisting>
+          </para>
+        </formalpara>
+      </xsl:if>
+
+      <xsl:apply-templates select="adr:doc"/>
+
+      <!-- Process the version elements, if any -->
+      <xsl:if test="adr:version">
+        <para>
+          <xsl:call-template name="header">
+            <xsl:with-param name="inline" select="1"/>
+            <xsl:with-param name="node">
+              <xsl:call-template name="getString">
+                <xsl:with-param name="name"
+                  select="'docbook.api.version.header'"/>
+              </xsl:call-template>
+            </xsl:with-param>
+          </xsl:call-template>
+          <xsl:text> </xsl:text>
+          <xsl:for-each select="adr:version">
+            <xsl:if test="position() != 1">
+              <xsl:text>, </xsl:text>
+            </xsl:if>
+            <xsl:value-of select="@stability"/>
+            <xsl:text>(</xsl:text>
+            <xsl:value-of select="@major"/>
+            <xsl:text>.</xsl:text>
+            <xsl:value-of select="@minor"/>
+            <xsl:text>)</xsl:text>
+          </xsl:for-each>
+        </para>
+      </xsl:if>
+
+      <!-- Process the api properties, if any -->
+      <xsl:if test="adr:property or adr:include">
+        <xsl:element name="{$element.section3}">
+          <title>
+            <xsl:call-template name="getString">
+              <xsl:with-param name="name"
+                select="'docbook.api.property.header'"/>
+              <xsl:with-param name="params">
+                <param>
+                  <xsl:value-of select="@name"/>
+                </param>
+              </xsl:with-param>
+            </xsl:call-template>
+          </title>
+          <xsl:apply-templates select="adr:property"/>
+          <xsl:apply-templates select="." mode="member-hierarchy">
+            <xsl:with-param name="member">property</xsl:with-param>
+            <xsl:with-param name="noneRes"
+              select="'docbook.api.property.inherited.none'"/>
+          </xsl:apply-templates>
+        </xsl:element>
+      </xsl:if>
+
+      <!-- Process the api methods, if any -->
+      <xsl:if test="adr:method or adr:include">
+        <xsl:element name="{$element.section3}">
+          <title>
+            <xsl:call-template name="getString">
+              <xsl:with-param name="name" select="'docbook.api.method.header'"/>
+              <xsl:with-param name="params">
+                <param>
+                  <xsl:value-of select="@name"/>
+                </param>
+              </xsl:with-param>
+            </xsl:call-template>
+          </title>
+          <xsl:apply-templates select="adr:method"/>
+          <xsl:apply-templates select="." mode="member-hierarchy">
+            <xsl:with-param name="member">method</xsl:with-param>
+            <xsl:with-param name="noneRes"
+              select="'docbook.api.method.inherited.none'"/>
+          </xsl:apply-templates>
+        </xsl:element>
+      </xsl:if>
+
+      <!-- Process the api events, if any -->
+      <xsl:if test="adr:event">
+        <xsl:element name="{$element.section3}">
+          <title>
+            <xsl:call-template name="getString">
+              <xsl:with-param name="name" select="'docbook.api.event.header'"/>
+              <xsl:with-param name="params">
+                <param>
+                  <xsl:value-of select="@name"/>
+                </param>
+              </xsl:with-param>
+            </xsl:call-template>
+          </title>
+          <xsl:apply-templates select="adr:event"/>
+        </xsl:element>
+      </xsl:if>
+    </xsl:element>
+  </xsl:template>
+
+  <!-- Process the property elements -->
+  <xsl:template match="adr:property">
+    <para id="{concat(../@name, '.', @name)}">
+      <xsl:apply-templates select="." mode="parameter">
+        <xsl:with-param name="strong" select="1"/>
+      </xsl:apply-templates>
+      <xsl:text> (</xsl:text>
+        <simplelist type="inline">
+          <member>
+            <emphasis>
+              <xsl:call-template name="getString">
+                <xsl:with-param name="name">
+                  <xsl:choose>
+                    <xsl:when test="@access='ro'">
+                      <xsl:text>docbook.api.property.ro</xsl:text>
+                    </xsl:when>
+                    <xsl:when test="@access='wo'">
+                      <xsl:text>docbook.api.property.wo</xsl:text>
+                    </xsl:when>
+                    <xsl:otherwise>
+                      <xsl:text>docbook.api.property.rw</xsl:text>
+                    </xsl:otherwise>
+                  </xsl:choose>
+                </xsl:with-param>
+              </xsl:call-template>
+            </emphasis>
+          </member>
+          <xsl:if test="@optional='true' or @optional='1'">
+            <member>
+              <emphasis>
+                <xsl:call-template name="getString">
+                  <xsl:with-param name="name"
+                    select="'docbook.general.optional'"/>
+                </xsl:call-template>
+              </emphasis>
+            </member>
+          </xsl:if>
+        </simplelist>
+      <xsl:text>)</xsl:text>
+
+      <xsl:apply-templates select="adr:summary" mode="inline"/>
+    </para>
+
+    <xsl:apply-templates select="adr:doc" mode="indent"/>
+    <xsl:apply-templates select="adr:error" mode="indent"/>
+  </xsl:template>
+
+  <!-- Process the property error elements -->
+  <xsl:template match="adr:property/adr:error">
+    <para>
+      <xsl:call-template name="header">
+        <xsl:with-param name="inline" select="1"/>
+        <xsl:with-param name="node">
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name">
+              <xsl:choose>
+                <xsl:when test="@for='ro' or ../@access='ro'">
+                  <xsl:text>docbook.api.property.error.header.ro</xsl:text>
+                </xsl:when>
+                <xsl:when test="@for='wo' or ../@access='wo'">
+                  <xsl:text>docbook.api.property.error.header.wo</xsl:text>
+                </xsl:when>
+                <xsl:when test="@for='rw' or ../@access='rw'">
+                  <xsl:text>docbook.api.property.error.header.rw</xsl:text>
+                </xsl:when>
+              </xsl:choose>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:with-param>
+      </xsl:call-template>
+      <xsl:text> </xsl:text>
+      <xsl:apply-templates select="." mode="type"/>
+      <xsl:apply-templates select="adr:summary" mode="inline"/>
+    </para>
+    <xsl:apply-templates select="adr:doc" mode="indent"/>
+  </xsl:template>
+
+  <!-- Process the method elements  -->
+  <xsl:template match="adr:method">
+    <para id="{concat(../@name, '.', @name)}">
+      <xsl:if test="adr:result">
+        <xsl:apply-templates select="adr:result" mode="type"/>
+        <xsl:text> </xsl:text>
+      </xsl:if>
+      <emphasis role="strong">
+        <xsl:value-of select="@name"/>
+      </emphasis>
+      <xsl:text>(</xsl:text>
+      <xsl:if test="adr:argument">
+        <simplelist type="inline">
+          <xsl:for-each select="adr:argument">
+            <member>
+              <xsl:apply-templates select="." mode="parameter"/>
+            </member>
+          </xsl:for-each>
+        </simplelist>
+      </xsl:if>
+      <xsl:text>)</xsl:text>
+    </para>
+
+    <xsl:call-template name="indent">
+      <xsl:with-param name="content">
+        <xsl:apply-templates select="adr:summary" mode="block"/>
+        <xsl:apply-templates select="adr:doc"/>
+
+        <xsl:if test="adr:argument">
+          <xsl:call-template name="header">
+            <xsl:with-param name="node">
+              <xsl:call-template name="getString">
+                <xsl:with-param name="name"
+                  select="'docbook.api.method.argument.header'"/>
+              </xsl:call-template>
+            </xsl:with-param>
+          </xsl:call-template>
+          <xsl:apply-templates select="adr:argument"/>
+        </xsl:if>
+
+        <xsl:if test="adr:result">
+          <xsl:call-template name="header">
+            <xsl:with-param name="node">
+              <xsl:call-template name="getString">
+                <xsl:with-param name="name"
+                  select="'docbook.api.method.result.header'"/>
+              </xsl:call-template>
+            </xsl:with-param>
+          </xsl:call-template>
+          <xsl:apply-templates select="adr:result"/>
+        </xsl:if>
+
+        <xsl:if test="adr:error">
+          <xsl:call-template name="header">
+            <xsl:with-param name="node">
+              <xsl:call-template name="getString">
+                <xsl:with-param name="name"
+                  select="'docbook.api.method.error.header'"/>
+              </xsl:call-template>
+            </xsl:with-param>
+          </xsl:call-template>
+          <xsl:apply-templates select="adr:error"/>
+        </xsl:if>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- Process the method argument elements -->
+  <xsl:template match="adr:argument">
+    <para>
+      <xsl:apply-templates select="." mode="paramname"/>
+      <xsl:apply-templates select="." mode="optional"/>
+      <xsl:apply-templates select="adr:summary" mode="inline"/>
+      <xsl:apply-templates select="adr:doc" mode="indent"/>
+    </para>
+  </xsl:template>
+
+  <!-- Process the method result elements -->
+  <xsl:template match="adr:result">
+    <para>
+      <xsl:apply-templates select="." mode="type"/>
+      <xsl:apply-templates select="." mode="optional"/>
+      <xsl:apply-templates select="adr:summary" mode="inline"/>
+      <xsl:apply-templates select="adr:doc" mode="indent"/>
+    </para>
+  </xsl:template>
+
+  <!-- Process the method error elements -->
+  <xsl:template match="adr:method/adr:error">
+    <para>
+      <xsl:apply-templates select="." mode="type"/>
+      <xsl:apply-templates select="adr:summary" mode="inline"/>
+    </para>
+    <xsl:apply-templates select="adr:doc" mode="indent"/>
+  </xsl:template>
+
+  <!-- Process the event elements -->
+  <xsl:template match="adr:event">
+    <para>
+      <xsl:apply-templates select="." mode="parameter">
+        <xsl:with-param name="strong" select="1"/>
+      </xsl:apply-templates>
+
+      <xsl:apply-templates select="adr:summary" mode="inline"/>
+    </para>
+
+    <xsl:apply-templates select="adr:doc" mode="indent"/>
+  </xsl:template>
+
+  <!-- Process the enum elements -->
+  <xsl:template match="adr:enum">
+    <para id="{@name}">
+      <xsl:call-template name="header">
+        <xsl:with-param name="inline" select="1"/>
+        <xsl:with-param name="node">
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name" select="'docbook.enum.label'"/>
+            <xsl:with-param name="params">
+              <param>
+                <xsl:value-of select="@name"/>
+              </param>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:with-param>
+      </xsl:call-template>
+      <xsl:apply-templates select="adr:summary" mode="inline"/>
+    </para>
+
+    <xsl:apply-templates select="adr:doc" mode="indent"/>
+
+    <xsl:call-template name="indent">
+      <xsl:with-param name="content">
+        <xsl:apply-templates select="adr:value[1]"/>
+        <xsl:apply-templates select="adr:fallback"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- Process the enum value elements -->
+  <xsl:template match="adr:value">
+    <xsl:param name="initval" select="0"/>
+    <xsl:variable name="currvalue">
+      <xsl:choose>
+        <xsl:when test="@value">
+          <xsl:value-of select="@value"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$initval"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <para id="{concat(../@name, '.', @name)}">
+      <xsl:call-template name="getString">
+        <xsl:with-param name="name" select="'docbook.enum.value'"/>
+        <xsl:with-param name="params">
+          <param>
+            <literal moreinfo="none">
+              <xsl:value-of select="@name"/>
+            </literal>
+          </param>
+          <param>
+            <xsl:value-of select="$currvalue"/>
+          </param>
+        </xsl:with-param>
+      </xsl:call-template>
+      <xsl:apply-templates select="adr:summary" mode="inline"/>
+    </para>
+    <xsl:apply-templates select="adr:doc" mode="indent"/>
+
+    <xsl:apply-templates select="following-sibling::adr:value[1]">
+      <xsl:with-param name="initval" select="$currvalue + 1"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <!-- Process the enum fallback elements -->
+  <xsl:template match="adr:fallback">
+    <para id="{concat(../@name, '.fallback')}">
+      <xsl:call-template name="getString">
+        <xsl:with-param name="name" select="'docbook.enum.fallback'"/>
+        <xsl:with-param name="params">
+          <param>
+            <literal moreinfo="none">
+              <xsl:value-of select="@name"/>
+            </literal>
+          </param>
+        </xsl:with-param>
+      </xsl:call-template>
+      <xsl:apply-templates select="adr:summary" mode="inline"/>
+    </para>
+    <xsl:apply-templates select="adr:doc" mode="indent"/>
+  </xsl:template>
+
+  <!-- Process the type elements -->
+  <xsl:template match="adr:type">
+    <para id="{@name}">
+      <xsl:call-template name="header">
+        <xsl:with-param name="inline" select="1"/>
+        <xsl:with-param name="node">
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name" select="'docbook.type.label'"/>
+            <xsl:with-param name="params">
+              <param>
+                <xsl:value-of select="@name"/>
+              </param>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:with-param>
+      </xsl:call-template>
+      <xsl:apply-templates select="adr:summary" mode="inline"/>
+    </para>
+
+    <xsl:if test="adr:include">
+      <xsl:call-template name="indent">
+        <xsl:with-param name="content">
+          <formalpara>
+            <title>
+              <xsl:call-template name="getString">
+                <xsl:with-param name="name"
+                  select="'docbook.type.inheritance.title'"/>
+              </xsl:call-template>
+            </title>
+            <para>
+              <programlisting format="linespecific">
+                <xsl:apply-templates select="." mode="hierarchy"/>
+              </programlisting>
+            </para>
+          </formalpara>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+
+    <xsl:apply-templates select="adr:doc" mode="indent"/>
+
+    <xsl:call-template name="indent">
+      <xsl:with-param name="content">
+        <!-- Fields: -->
+        <xsl:call-template name="header">
+          <xsl:with-param name="node">
+            <xsl:call-template name="getString">
+              <xsl:with-param name="name" select="'docbook.type.field.header'"/>
+            </xsl:call-template>
+          </xsl:with-param>
+        </xsl:call-template>
+        <xsl:apply-templates select="adr:field"/>
+
+        <!-- Inherited Fields: -->
+        <xsl:apply-templates select="." mode="member-hierarchy">
+          <xsl:with-param name="member">field</xsl:with-param>
+          <xsl:with-param name="noneRes"
+            select="'docbook.type.field.inherited.none'"/>
+        </xsl:apply-templates>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- Process the type field elements -->
+  <xsl:template match="adr:type/adr:field">
+    <para id="{concat(../@name, '.', @name)}">
+      <xsl:apply-templates select="." mode="parameter"/>
+      <xsl:apply-templates select="." mode="optional"/>
+      <xsl:apply-templates select="adr:summary" mode="inline"/>
+    </para>
+    <xsl:apply-templates select="adr:doc" mode="indent"/>
+  </xsl:template>
+
+  <!-- Process the union elements -->
+  <xsl:template match="adr:union">
+    <para id="{@name}">
+      <xsl:call-template name="header">
+        <xsl:with-param name="inline" select="1"/>
+        <xsl:with-param name="node">
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name" select="'docbook.union.label'"/>
+            <xsl:with-param name="params">
+              <param>
+                <xsl:value-of select="@name"/>
+              </param>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:with-param>
+      </xsl:call-template>
+      <emphasis role="strong">
+        <xsl:text> (</xsl:text>
+          <xsl:apply-templates select="." mode="type"/>
+        <xsl:text>)</xsl:text>
+      </emphasis>
+      <xsl:apply-templates select="adr:summary" mode="inline"/>
+    </para>
+
+    <xsl:apply-templates select="adr:doc" mode="indent"/>
+
+    <xsl:call-template name="indent">
+      <xsl:with-param name="content">
+        <xsl:apply-templates select="adr:arm"/>
+        <xsl:apply-templates select="adr:default"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- Process the union arm elements -->
+  <xsl:template match="adr:arm">
+    <para>
+      <xsl:call-template name="getString">
+        <xsl:with-param name="name" select="'docbook.union.arm.label'"/>
+        <xsl:with-param name="params">
+          <param>
+            <literal moreinfo="none">
+              <xsl:choose>
+                <xsl:when test="../@typeref">
+                  <link linkend="{concat(../@typeref, '.', @value)}">
+                    <xsl:value-of select="@value"/>
+                  </link>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:value-of select="@value"/>
+                </xsl:otherwise>
+              </xsl:choose>
+            </literal>
+          </param>
+          <param>
+            <xsl:apply-templates select="." mode="type"/>
+          </param>
+        </xsl:with-param>
+      </xsl:call-template>
+      <xsl:apply-templates select="." mode="optional"/>
+      <xsl:apply-templates select="adr:summary" mode="inline"/>
+    </para>
+    <xsl:apply-templates select="adr:doc" mode="indent"/>
+  </xsl:template>
+
+  <!-- Process the default union element -->
+  <xsl:template match="adr:default">
+    <para>
+      <xsl:call-template name="getString">
+        <xsl:with-param name="name" select="'docbook.union.default.label'"/>
+        <xsl:with-param name="params">
+          <param>
+            <xsl:apply-templates select="." mode="type"/>
+          </param>
+        </xsl:with-param>
+      </xsl:call-template>
+      <xsl:apply-templates select="." mode="optional"/>
+      <xsl:apply-templates select="adr:summary" mode="inline"/>
+    </para>
+    <xsl:apply-templates select="adr:doc" mode="indent"/>
+  </xsl:template>
+
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/java/adr/xml/style/radadr-docbook-man.xsl	Wed Mar 14 10:45:15 2012 -0400
@@ -0,0 +1,192 @@
+<?xml version="1.0"?>
+<!--
+  Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+
+  CDDL HEADER START
+
+   The contents of this file are subject to the terms of the
+   Common Development and Distribution License (the "License").
+   You may not use this file except in compliance with the License.
+
+   You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+   or http://www.opensolaris.org/os/licensing.
+   See the License for the specific language governing permissions
+   and limitations under the License.
+
+   When distributing Covered Code, include this CDDL HEADER in each
+   file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+   If applicable, add the following below this CDDL HEADER, with the
+   fields enclosed by brackets "[]" replaced with your own identifying
+   information: Portions Copyright [yyyy] [name of copyright owner]
+
+  CDDL HEADER END
+-->
+
+<xsl:stylesheet version="1.0"
+  xmlns:adr="http://www.opensolaris.org/ns/adr"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  exclude-result-prefixes="adr">
+
+  <!-- Common docbook xsl templates -->
+  <xsl:import href="radadr-docbook-common.xsl"/>
+
+  <xsl:output method="xml" version="1.0" encoding="UTF-8"
+      indent="no" omit-xml-declaration="no" standalone="no"
+      doctype-public="-//OASIS//DTD DocBook V4.4//EN"
+      doctype-system="http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"/>
+
+  <!-- Manpage-specific content -->
+  <xsl:variable name="element.section1">refsect1</xsl:variable>
+  <xsl:variable name="element.section2">refsect2</xsl:variable>
+  <xsl:variable name="element.section3">refsect3</xsl:variable>
+
+  <xsl:strip-space elements="*"/>
+
+  <xsl:template match="/">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="adr:interface">
+    <xsl:variable name="basename">
+      <xsl:call-template name="basename">
+        <xsl:with-param name="str" select='@name'/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:element name="refentry">
+      <xsl:attribute name='id'>
+        <xsl:value-of select="concat('man.', $basename)"/>
+      </xsl:attribute>
+
+      <refentryinfo>
+        <productname>SunOS</productname>
+        <productnumber>5.11</productnumber>
+      </refentryinfo>
+
+      <refmeta>
+        <refentrytitle>
+          <xsl:value-of select="$basename"/>
+        </refentrytitle>
+        <manvolnum>3rad</manvolnum>
+        <refmiscinfo class="manual">
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name" select="'docbook.man.refmiscinfo'"/>
+          </xsl:call-template>
+        </refmiscinfo>
+      </refmeta>
+
+      <refnamediv>
+        <refname>
+          <xsl:value-of select="$basename"/>
+        </refname>
+        <xsl:if test="adr:summary">
+          <refpurpose>
+            <xsl:apply-templates select="adr:summary" mode="inline">
+              <xsl:with-param name="usehyphen" select="0"/>
+            </xsl:apply-templates>
+          </refpurpose>
+        </xsl:if>
+      </refnamediv>
+
+      <refsynopsisdiv>
+        <xsl:apply-templates select="adr:api" mode="synopsis"/>
+      </refsynopsisdiv>
+
+      <refsect1 role="description">
+        <title>
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name"
+              select="'docbook.man.section.description'"/>
+          </xsl:call-template>
+        </title>
+
+        <xsl:call-template name="header">
+          <xsl:with-param name="node">
+            <xsl:call-template name="getString">
+              <xsl:with-param name="name" select="'docbook.interface.label'"/>
+              <xsl:with-param name="params">
+                <param>
+                  <xsl:value-of select="@name"/>
+                </param>
+              </xsl:with-param>
+            </xsl:call-template>
+          </xsl:with-param>
+        </xsl:call-template>
+
+        <xsl:apply-templates select="adr:doc"/>
+      </refsect1>
+
+      <xsl:apply-templates select="." mode="children"/>
+    </xsl:element>
+  </xsl:template>
+
+  <xsl:template match="adr:api" mode="synopsis">
+    <refsect2>
+      <title>
+        <xsl:call-template name="getString">
+          <xsl:with-param name="name" select="'docbook.api.label'"/>
+          <xsl:with-param name="params">
+            <param>
+              <xsl:value-of select="@name"/>
+            </param>
+          </xsl:with-param>
+        </xsl:call-template>
+      </title>
+      <synopsis>
+        <xsl:apply-templates select="adr:property" mode="synopsis"/>
+      </synopsis>
+      <xsl:apply-templates select="adr:method" mode="synopsis"/>
+    </refsect2>
+  </xsl:template>
+
+  <xsl:template match="adr:property" mode="synopsis">
+    <fieldsynopsis>
+      <xsl:apply-templates select="." mode="type"/>
+      <varname>
+        <xsl:value-of select="@name"/>
+      </varname>
+    </fieldsynopsis>
+  </xsl:template>
+
+  <xsl:template match="adr:method" mode="synopsis">
+    <synopsis>
+      <methodsynopsis>
+        <xsl:apply-templates select="adr:result" mode="type"/>
+        <methodname>
+          <xsl:value-of select="@name"/>
+        </methodname>
+        <xsl:choose>
+          <xsl:when test="not(adr:argument)">
+            <void/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:for-each select="adr:argument">
+              <methodparam>
+                <xsl:apply-templates select="." mode="type"/>
+                <parameter>
+                  <xsl:value-of select="@name"/>
+                </parameter>
+              </methodparam>
+            </xsl:for-each>
+          </xsl:otherwise>
+        </xsl:choose>
+      </methodsynopsis>
+    </synopsis>
+  </xsl:template>
+
+  <xsl:template name="basename">
+    <xsl:param name="str"/>
+    <xsl:param name="delim">.</xsl:param>
+    <xsl:choose>
+      <xsl:when test="contains($str, $delim)">
+          <xsl:call-template name="basename">
+            <xsl:with-param name="str" select="substring-after($str, $delim)"/>
+          </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+          <xsl:value-of select="$str"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/java/adr/xml/style/radadr-docbook.xsl	Wed Mar 14 10:45:15 2012 -0400
@@ -0,0 +1,85 @@
+<?xml version="1.0"?>
+<!--
+  Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+
+  CDDL HEADER START
+
+   The contents of this file are subject to the terms of the
+   Common Development and Distribution License (the "License").
+   You may not use this file except in compliance with the License.
+
+   You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+   or http://www.opensolaris.org/os/licensing.
+   See the License for the specific language governing permissions
+   and limitations under the License.
+
+   When distributing Covered Code, include this CDDL HEADER in each
+   file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+   If applicable, add the following below this CDDL HEADER, with the
+   fields enclosed by brackets "[]" replaced with your own identifying
+   information: Portions Copyright [yyyy] [name of copyright owner]
+
+  CDDL HEADER END
+-->
+
+<xsl:stylesheet version="1.0" xmlns:adr="http://www.opensolaris.org/ns/adr"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <!-- Common docbook xsl templates -->
+  <xsl:import href="radadr-docbook-common.xsl"/>
+
+  <!-- Write the opening elements -->
+  <xsl:output method="xml" version="1.0" encoding="UTF-8"
+      indent="no" omit-xml-declaration="no" standalone="yes"
+      doctype-public="-//OASIS//DTD DocBook V4.4//EN"
+      doctype-system="http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"/>
+
+  <!-- Override API hierarchy characters -->
+  <xsl:variable name="hierarchy.boxdr">&boxdr;</xsl:variable>
+  <xsl:variable name="hierarchy.boxh">&boxh;</xsl:variable>
+  <xsl:variable name="hierarchy.boxv">&boxv;</xsl:variable>
+  <xsl:variable name="hierarchy.boxvr">&boxvr;</xsl:variable>
+
+  <xsl:strip-space elements="*"/>
+
+  <xsl:template match="/">
+    <article>
+      <xsl:apply-templates/>
+    </article>
+  </xsl:template>
+
+  <!-- Process the interface element -->
+  <xsl:template match="adr:interface">
+    <!-- Write out a heading -->
+    <section>
+      <title>
+        <xsl:call-template name="getString">
+          <xsl:with-param name="name" select="'docbook.interface.title'"/>
+          <xsl:with-param name="params">
+            <param>
+              <xsl:value-of select="@name"/>
+            </param>
+          </xsl:with-param>
+        </xsl:call-template>
+      </title>
+      <para>
+        <emphasis role="strong">
+          <xsl:call-template name="getString">
+            <xsl:with-param name="name" select="'docbook.interface.label'"/>
+            <xsl:with-param name="params">
+              <param>
+                <xsl:value-of select="@name"/>
+              </param>
+            </xsl:with-param>
+          </xsl:call-template>
+        </emphasis>
+        <xsl:apply-templates select="adr:summary" mode="inline"/>
+      </para>
+      <xsl:apply-templates select="adr:doc"/>
+
+      <!-- Process interface children -->
+      <xsl:apply-templates select="." mode="children"/>
+    </section>
+  </xsl:template>
+
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/java/adr/xml/style/radadr-rmdoc.xsl	Wed Mar 14 10:45:15 2012 -0400
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<!--
+  CDDL HEADER START
+
+  The contents of this file are subject to the terms of the
+  Common Development and Distribution License (the "License").
+  You may not use this file except in compliance with the License.
+
+  You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+  or http://www.opensolaris.org/os/licensing.
+  See the License for the specific language governing permissions
+  and limitations under the License.
+
+  When distributing Covered Code, include this CDDL HEADER in each
+  file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+  If applicable, add the following below this CDDL HEADER, with the
+  fields enclosed by brackets "[]" replaced with your own identifying
+  information: Portions Copyright [yyyy] [name of copyright owner]
+
+  CDDL HEADER END
+
+  Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+-->
+
+<!-- Strips documentation elements from ADR interface definitions -->
+<xsl:stylesheet version="1.0" xmlns:adr="http://www.opensolaris.org/ns/adr"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <xsl:output method="xml" version="1.0" encoding="UTF-8" 
+    indent="yes" omit-xml-declaration="no" standalone="yes"/>
+  <xsl:strip-space elements="*"/>
+
+  <!-- identity templates -->
+  <xsl:template match="node()|@*">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+
+  <!-- strip out document elements -->
+  <xsl:template match="adr:summary |adr:doc"/>
+</xsl:stylesheet>
--- a/usr/src/java/build-common.xml	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/java/build-common.xml	Wed Mar 14 10:45:15 2012 -0400
@@ -23,248 +23,251 @@
 -->
 
 <project name="commondef">
-	<import file="env-common.xml"/>
+  <import file="env-common.xml"/>
 
-	<!--
-	  Projects can redefine these paths to set the classpath for
-	  javac, javadoc (uses classpath.javac), and jar tasks.
-	-->
-	<path id="classpath.javac" />
-	<path id="classpath.jar" refid="classpath.javac" />
+  <!--
+    Projects can redefine these paths to set the classpath for
+    javac, javadoc (uses classpath.javac), and jar tasks.
+  -->
+  <path id="classpath.javac" />
+  <path id="classpath.jar" refid="classpath.javac" />
 
-	<presetdef name="copy.remove.cddl">
-	    <copy>
-		<filterchain>
-			<filterreader
-			    classname="com.oracle.solaris.util.ant.RemoveCDDLFilterReader">
-				
-			    <classpath>
-				    <pathelement
-					path="${ws.java}/ant/ant.jar"/>
-			    </classpath> 
-			</filterreader>
-		</filterchain>
-	    </copy>
-	</presetdef>
+  <presetdef name="copy.remove.cddl">
+      <copy>
+    <filterchain>
+      <filterreader
+          classname="com.oracle.solaris.util.ant.RemoveCDDLFilterReader">
+
+          <classpath>
+            <pathelement path="${ws.java}/ant/ant.jar"/>
+          </classpath>
+      </filterreader>
+    </filterchain>
+      </copy>
+  </presetdef>
 
-	<!--
-	  Generic copy/filter-based file generation task.
-	-->
-	<macrodef name="generate.filter">
-		<attribute name="pattern" />
-		<attribute name="fromdir" default="." />
-		<attribute name="from" />
-		<attribute name="to" />
-		<element name="filters" implicit="yes" />
-		<sequential>
-			<copy todir="${proj.gen}">
-				<globmapper from="@{from}" to="@{to}" />
-				<fileset dir="@{fromdir}"
-				    includes="@{pattern}" />
-				<filterset begintoken="&lt;" endtoken="&gt;">
-				    <filters />
-				</filterset>
-			</copy>
-		</sequential>
-	</macrodef>
+  <!--
+    Generic copy/filter-based file generation task.
+  -->
+  <macrodef name="generate.filter">
+    <attribute name="pattern" />
+    <attribute name="fromdir" default="." />
+    <attribute name="from" />
+    <attribute name="to" />
+    <element name="filters" implicit="yes" />
+    <sequential>
+      <copy todir="${proj.gen}">
+        <globmapper from="@{from}" to="@{to}" />
+        <fileset dir="@{fromdir}"
+            includes="@{pattern}" />
+        <filterset begintoken="&lt;" endtoken="&gt;">
+            <filters />
+        </filterset>
+      </copy>
+    </sequential>
+  </macrodef>
 
-	<macrodef name="generate.adr">
-		<attribute name="api" />
-		<sequential>
-			<java fork="yes" classpath="${ws.java}/adr/adr.jar"
-			    classname="org.opensolaris.os.adr.adrgen.RadADRGen">
-				<arg value="-j" />
-				<arg value="${proj.gen}" />
-				<arg value="${ws.apis}/@{api}" />
-			</java>
-		</sequential>
-	</macrodef>
+  <property name="adrdir" location="${ws.java}/adr" />
+  <macrodef name="generate.adr">
+    <attribute name="api" />
+    <sequential>
+      <exec executable="${adrdir}/radadrgen.sh">
+        <env key="RADADR_SCHEMA" value="${adrdir}/xml/rng/radadr.rng"/>
+        <env key="RADADR_XSLDIR" value="${adrdir}/xml/style"/>
+        <env key="RADADR_JARDIR" value="${adrdir}"/>
+        <arg value="-j" />
+        <arg value="${proj.gen}" />
+        <arg value="${ws.apis}/@{api}" />
+      </exec>
+    </sequential>
+  </macrodef>
 
-	<macrodef name="generate.adropt">
-		<attribute name="api" />
-		<sequential>
-			<java fork="yes" classpath="${ws.java}/adr/adr.jar"
-			    classname="org.opensolaris.os.adr.adrgen.RadADRGen">
-				<arg value="-N" />
-				<arg value="-j" />
-				<arg value="${proj.gen}" />
-				<arg value="${ws.apis}/@{api}" />
-			</java>
-		</sequential>
-	</macrodef>
+  <macrodef name="generate.adropt">
+    <attribute name="api" />
+    <sequential>
+      <exec executable="${adrdir}/radadrgen.sh">
+        <env key="RADADR_SCHEMA" value="${adrdir}/xml/rng/radadr.rng"/>
+        <env key="RADADR_XSLDIR" value="${adrdir}/xml/style"/>
+        <env key="RADADR_JARDIR" value="${adrdir}"/>
+        <arg value="-N" />
+        <arg value="-j" />
+        <arg value="${proj.gen}" />
+        <arg value="${ws.apis}/@{api}" />
+      </exec>
+    </sequential>
+  </macrodef>
 
-	<macrodef name="generate.adrimpl">
-		<attribute name="api" />
-		<sequential>
-			<java fork="yes" classpath="${ws.java}/adr/adr.jar"
-			    classname="org.opensolaris.os.adr.adrgen.RadADRGen">
-				<arg value="-j" />
-				<arg value="${proj.gen}" />
-				<arg value="-i" />
-				<arg value="${ws.apis}/@{api}" />
-			</java>
-		</sequential>
-	</macrodef>
-
-	<target name="generate_project" />
-	<target name="generate" depends="generate_project">
-		<mkdir dir="${proj.gen}" />
-	</target>
+  <macrodef name="generate.adrimpl">
+    <attribute name="api" />
+    <sequential>
+      <exec executable="${adrdir}/radadrgen.sh">
+        <env key="RADADR_SCHEMA" value="${adrdir}/xml/rng/radadr.rng"/>
+        <env key="RADADR_XSLDIR" value="${adrdir}/xml/style"/>
+        <env key="RADADR_JARDIR" value="${adrdir}"/>
+        <arg value="-j" />
+        <arg value="${proj.gen}" />
+        <arg value="-i" />
+        <arg value="${ws.apis}/@{api}" />
+      </exec>
+    </sequential>
+  </macrodef>
 
-	<target name="clean_project" />
-	<target name="clean" depends="clean_project">
-		<delete dir="${proj.build}" />
-	</target>
+  <target name="generate_project" />
+  <target name="generate" depends="generate_project">
+    <mkdir dir="${proj.gen}" />
+  </target>
 
-	<target name="clobber_project" />
-	<target name="clobber" depends="clean,clobber_project">
-		<delete file="${proj.jarfile}" />
-	</target>
+  <target name="clean_project" />
+  <target name="clean" depends="clean_project">
+    <delete dir="${proj.build}" />
+  </target>
+
+  <target name="clobber_project" />
+  <target name="clobber" depends="clean,clobber_project">
+    <delete file="${proj.jarfile}" />
+  </target>
 
-	<!--
-	  Default compile target body.
-	-->
-	<presetdef name="javac.default">
-		<javac includeAntRuntime="no" sourcepathref="proj.srcroots"
-		    destdir="${proj.classes}" debug="on"
-		    classpathref="classpath.javac">
-		    <src>
-			<dirset dir=".">
-			    <include name="com"/>
-			    <include name="org"/>
-			</dirset>
-		    </src>
-		    <src location="build/gen" />
-		    <compilerarg value="-Xlint" />
-		    <compilerarg value="-Xlint:-serial" />
-		</javac>
-	</presetdef>
-
-	<target name="compile_project" />
-	<target name="compile" depends="generate,compile_project">
-		<mkdir dir="${proj.classes}" />
-		<javac.default />
-	</target>
+  <!--
+    Default compile target body.
+  -->
+  <presetdef name="javac.default">
+    <javac includeAntRuntime="no" sourcepathref="proj.srcroots"
+        destdir="${proj.classes}" debug="on"
+        classpathref="classpath.javac">
+      <src>
+        <dirset dir=".">
+          <include name="com"/>
+          <include name="org"/>
+        </dirset>
+      </src>
+      <src location="build/gen" />
+      <compilerarg value="-Xlint" />
+      <compilerarg value="-Xlint:-serial" />
+    </javac>
+  </presetdef>
 
-	<!--
-	  Default jar target body.
-	-->
-	<presetdef name="jar.default">
-		<jar destfile="${proj.jarfile}">
-			<fileset dir="${proj.classes}" />
-			<fileset dir=".">
-				<patternset id="pattern.resources">
-					<!-- <include name="org/**/*.rng" /> -->
-					<include name="org/**/*.xsd" />
-					<include name="org/**/*.xsl" />
-					<include name="org/**/*.properties" />
-					<include name="org/**/panel.policy" />
-					<include name="org/**/help/**" />
-					<include name="org/**/images/**" />
-					<exclude name="org/**/images/**/*.xcf" />
-				</patternset>
-			</fileset>
-			<fileset dir="${proj.gen}">
-				<patternset refid="pattern.resources" />
-			</fileset>
-		</jar>
-	</presetdef>
+  <target name="compile_project" />
+  <target name="compile" depends="generate,compile_project">
+    <mkdir dir="${proj.classes}" />
+    <javac.default />
+  </target>
 
-	<!--
-	  A pathmapper that maps from a classpath in build-space to
-	  install-space, mapping paths in the workspace to a single
-	  directory and leaving absolute paths alone.
-	-->
-	<macrodef name="map.targetjar">
-		<attribute name="targetdir" default="${abs.java}" />
-		<attribute name="pathsep" default=" " />
-		<attribute name="property" />
-		<attribute name="pathref" />
-		<sequential>
-			<pathconvert pathsep="@{pathsep}" property="@{property}"
-			    refid="@{pathref}">
-				<filtermapper>
-					<replaceregex pattern="^${ws.java}/.*/"
-					    replace="@{targetdir}/" />
-				</filtermapper>
-			</pathconvert>
-		</sequential>
-	</macrodef>
+  <!--
+    Default jar target body.
+  -->
+  <presetdef name="jar.default">
+    <jar destfile="${proj.jarfile}">
+      <fileset dir="${proj.classes}" />
+      <fileset dir=".">
+        <patternset id="pattern.resources">
+          <include name="org/**/*.properties" />
+          <include name="org/**/panel.policy" />
+          <include name="org/**/help/**" />
+          <include name="org/**/images/**" />
+          <exclude name="org/**/images/**/*.xcf" />
+        </patternset>
+      </fileset>
+      <fileset dir="${proj.gen}">
+        <patternset refid="pattern.resources" />
+      </fileset>
+    </jar>
+  </presetdef>
+
+  <!--
+    A pathmapper that maps from a classpath in build-space to
+    install-space, mapping paths in the workspace to a single
+    directory and leaving absolute paths alone.
+  -->
+  <macrodef name="map.targetjar">
+    <attribute name="targetdir" default="${abs.java}" />
+    <attribute name="pathsep" default=" " />
+    <attribute name="property" />
+    <attribute name="pathref" />
+    <sequential>
+      <pathconvert pathsep="@{pathsep}" property="@{property}"
+          refid="@{pathref}">
+        <filtermapper>
+          <replaceregex pattern="^${ws.java}/.*/"
+              replace="@{targetdir}/" />
+        </filtermapper>
+      </pathconvert>
+    </sequential>
+  </macrodef>
 
-	<!--
-	  Alternate jar target body, used for creating executables.
-	-->
-	<macrodef name="jar.executable">
-		<attribute name="mainclass" />
-		<attribute name="targetdir" default="${abs.java}" />
-		<element name="jar-elements" implicit="yes" optional="yes"/>
-		<sequential>
-			<map.targetjar targetdir="@{targetdir}"
-			    property="jarclasspath" pathref="classpath.jar" />
-			<jar.default>
-			<manifest>
-				<attribute name="Main-Class"
-				    value="@{mainclass}" />
-				<attribute name="Class-Path"
-				    value="${jarclasspath}" />
-			</manifest>
-			<jar-elements />
-			</jar.default>
-		</sequential>
-	</macrodef>
+  <!--
+    Alternate jar target body, used for creating executables.
+  -->
+  <macrodef name="jar.executable">
+    <attribute name="mainclass" />
+    <attribute name="targetdir" default="${abs.java}" />
+    <element name="jar-elements" implicit="yes" optional="yes"/>
+    <sequential>
+      <map.targetjar targetdir="@{targetdir}"
+          property="jarclasspath" pathref="classpath.jar" />
+      <jar.default>
+      <manifest>
+        <attribute name="Main-Class"
+            value="@{mainclass}" />
+        <attribute name="Class-Path"
+            value="${jarclasspath}" />
+      </manifest>
+      <jar-elements />
+      </jar.default>
+    </sequential>
+  </macrodef>
 
-	<target name="jar" depends="compile">
-		<jar.default />
-	</target>
+  <target name="jar" depends="compile">
+    <jar.default />
+  </target>
 
-	<!--
-	  Default javadoc target body.
-	-->
-	<presetdef name="javadoc.default">
-		<javadoc noqualifier="all" sourcepathref="proj.srcroots"
-		    destdir="${proj.javadoc}" classpathref="classpath.javac">
-			<packageset dir="." includes="org/" />
-		</javadoc>
-	</presetdef>
+  <!--
+    Default javadoc target body.
+  -->
+  <presetdef name="javadoc.default">
+    <javadoc noqualifier="all" sourcepathref="proj.srcroots"
+        destdir="${proj.javadoc}" classpathref="classpath.javac">
+      <packageset dir="." includes="org/" />
+    </javadoc>
+  </presetdef>
 
-	<target name="javadoc" unless="env.ANT_SKIP_JAVADOC">
-		<javadoc.default />
-	</target>
+  <target name="javadoc" unless="env.ANT_SKIP_JAVADOC">
+    <javadoc.default />
+  </target>
 
-	<!--
-	  Default install target body.
-	-->
-	<macrodef name="install.default">
-		<attribute name="targetdir" default="${proto.java}" />
-		<sequential>
-			<mkdir dir="@{targetdir}" />
-			<copy file="${proj.jarfile}" todir="@{targetdir}" />
-		</sequential>
-	</macrodef>
+  <!--
+    Default install target body.
+  -->
+  <macrodef name="install.default">
+    <attribute name="targetdir" default="${proto.java}" />
+    <sequential>
+      <mkdir dir="@{targetdir}" />
+      <copy file="${proj.jarfile}" todir="@{targetdir}" />
+    </sequential>
+  </macrodef>
 
-	<!--
-	  Optionally used by a project's install_project to install
-	  javadoc.  Currently copies from build/javadoc; in the future
-	  it might make sense to build javadoc differently in, and
-	  directly into, each location.
-	-->
-	<macrodef name="install.javadoc">
-		<sequential>
-			<copy todir="${proto.javadoc}">
-				<fileset dir="${proj.javadoc}"
-				    erroronmissingdir="false"/>
-			</copy>
-		</sequential>
-	</macrodef>
+  <!--
+    Optionally used by a project's install_project to install
+    javadoc.  Currently copies from build/javadoc; in the future
+    it might make sense to build javadoc differently in, and
+    directly into, each location.
+  -->
+  <macrodef name="install.javadoc">
+    <sequential>
+      <copy todir="${proto.javadoc}">
+        <fileset dir="${proj.javadoc}"
+            erroronmissingdir="false"/>
+      </copy>
+    </sequential>
+  </macrodef>
 
-	<target name="install_project" />
+  <target name="install_project" />
 
-	<target name="install" depends="jar,install_project">
-		<!-- Temporarily set targetdir -->
-		<install.default targetdir="${proto.vpanels}" />
-	</target>
+  <target name="install" depends="jar,install_project">
+    <!-- Temporarily set targetdir -->
+    <install.default targetdir="${proto.vpanels}" />
+  </target>
 
-	<target name="all" depends="jar,javadoc" />
+  <target name="all" depends="jar,javadoc" />
 
-	<target name="lint" />
+  <target name="lint" />
 </project>
--- a/usr/src/java/rad/org/opensolaris/os/rad/Client.java	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/java/rad/org/opensolaris/os/rad/Client.java	Wed Mar 14 10:45:15 2012 -0400
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
  */
 
 package org.opensolaris.os.rad;
@@ -386,7 +386,7 @@
 	}
 
 	API api = new API(aname, vers, props, meths, events,
-	    new ArrayList<API>(iface.getAPIs()));
+	    new ArrayList<API>(iface.getAPIs().values()));
 	iface.addAPI(api);
 
 	return api;
--- a/usr/src/pkg/manifests/system-management-rad-client-rad-java.p5m	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/pkg/manifests/system-management-rad-client-rad-java.p5m	Wed Mar 14 10:45:15 2012 -0400
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 license cr_Oracle license=cr_Oracle
@@ -41,4 +41,4 @@
 
 # Needed for adr.jar
 depend fmri=pkg:/system/management/rad@$(PKGVERS) type=require
-depend fmri=pkg:/runtime/java type=require
+depend fmri=pkg:/runtime/java/jre-6 type=require
--- a/usr/src/pkg/manifests/system-management-rad-module-rad-kstat.p5m	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/pkg/manifests/system-management-rad-module-rad-kstat.p5m	Wed Mar 14 10:45:15 2012 -0400
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 license cr_Oracle license=cr_Oracle
@@ -34,5 +34,8 @@
 dir path=usr/lib/rad
 dir path=usr/lib/rad/module
 file path=usr/lib/rad/module/kstat.so
-# Future: usr/lib/rad/apis/kstat.xml
+dir path=usr/share group=sys facet.devel=true
+dir path=usr/share/man facet.devel=true
+dir path=usr/share/man/man3rad facet.devel=true
+file path=usr/share/man/man3rad/kstat.3rad facet.devel=true
 depend fmri=pkg:/system/management/rad@$(PKGVERS) type=require
--- a/usr/src/pkg/manifests/system-management-rad-module-rad-smf.p5m	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/pkg/manifests/system-management-rad-module-rad-smf.p5m	Wed Mar 14 10:45:15 2012 -0400
@@ -33,9 +33,11 @@
 dir path=usr/lib
 dir path=usr/lib/rad
 dir path=usr/lib/rad/java
+file path=usr/lib/rad/java/smf.jar
 dir path=usr/lib/rad/module
 file path=usr/lib/rad/module/mod_smf.so
-# Future: usr/lib/rad/apis/smf.xml
-dir path=usr/share group=sys
-file path=usr/lib/rad/java/smf.jar
+dir path=usr/share group=sys facet.devel=true
+dir path=usr/share/man facet.devel=true
+dir path=usr/share/man/man3rad facet.devel=true
+file path=usr/share/man/man3rad/smf.3rad facet.devel=true
 depend fmri=pkg:/system/management/rad@$(PKGVERS) type=require
--- a/usr/src/pkg/manifests/system-management-rad-module-rad-zones-bridge.p5m	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/pkg/manifests/system-management-rad-module-rad-zones-bridge.p5m	Wed Mar 14 10:45:15 2012 -0400
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 license cr_Oracle license=cr_Oracle
@@ -34,4 +34,8 @@
 dir path=usr/lib/rad
 dir path=usr/lib/rad/module
 file path=usr/lib/rad/module/mod_zonesbridge.so
+dir path=usr/share group=sys facet.devel=true
+dir path=usr/share/man facet.devel=true
+dir path=usr/share/man/man3rad facet.devel=true
+file path=usr/share/man/man3rad/zonesbridge.3rad facet.devel=true
 depend fmri=pkg:/system/management/rad@$(PKGVERS) type=require
--- a/usr/src/pkg/manifests/system-management-rad.p5m	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/pkg/manifests/system-management-rad.p5m	Wed Mar 14 10:45:15 2012 -0400
@@ -42,31 +42,31 @@
 dir path=usr/include facet.devel=true
 dir path=usr/include/rad facet.devel=true
 file path=usr/include/rad/adr.h facet.devel=true
+file path=usr/include/rad/adr_name.h facet.devel=true
 file path=usr/include/rad/adr_object.h facet.devel=true
-file path=usr/include/rad/adr_name.h facet.devel=true
 file path=usr/include/rad/adr_stream.h facet.devel=true
+file path=usr/include/rad/rad_modapi.h facet.devel=true
 file path=usr/include/rad/radclient.h facet.devel=true
-file path=usr/include/rad/rad_modapi.h facet.devel=true
+dir path=usr/lib/$(ARCH64)
+link path=usr/lib/$(ARCH64)/libadr.so target=libadr.so.1 facet.devel=true
+file path=usr/lib/$(ARCH64)/libadr.so.1
+link path=usr/lib/$(ARCH64)/libradproto.so target=libradproto.so.1 facet.devel=true
+file path=usr/lib/$(ARCH64)/libradproto.so.1
+file path=usr/lib/$(ARCH64)/llib-ladr.ln facet.devel=true
+file path=usr/lib/$(ARCH64)/llib-lradproto.ln facet.devel=true
+link path=usr/lib/libadr.so target=libadr.so.1 facet.devel=true
+file path=usr/lib/libadr.so.1
+link path=usr/lib/libradproto.so target=libradproto.so.1 facet.devel=true
+file path=usr/lib/libradproto.so.1
 file path=usr/lib/llib-ladr facet.devel=true
 file path=usr/lib/llib-ladr.ln facet.devel=true
-file path=usr/lib/libadr.so.1
-link path=usr/lib/libadr.so target=libadr.so.1 facet.devel=true
 file path=usr/lib/llib-lradproto facet.devel=true
 file path=usr/lib/llib-lradproto.ln facet.devel=true
-file path=usr/lib/libradproto.so.1
-link path=usr/lib/libradproto.so target=libradproto.so.1 facet.devel=true
-dir path=usr/lib/$(ARCH64)
-file path=usr/lib/$(ARCH64)/llib-ladr.ln facet.devel=true
-file path=usr/lib/$(ARCH64)/libadr.so.1
-link path=usr/lib/$(ARCH64)/libadr.so target=libadr.so.1 facet.devel=true
-file path=usr/lib/$(ARCH64)/llib-lradproto.ln facet.devel=true
-file path=usr/lib/$(ARCH64)/libradproto.so.1
-link path=usr/lib/$(ARCH64)/libradproto.so target=libradproto.so.1 facet.devel=true
 dir path=usr/lib/mdb group=sys
 dir path=usr/lib/mdb/proc group=sys
-file path=usr/lib/mdb/proc/rad.so
+file path=usr/lib/mdb/proc/$(ARCH64)/libadr.so
 file path=usr/lib/mdb/proc/libadr.so
-file path=usr/lib/mdb/proc/$(ARCH64)/libadr.so
+file path=usr/lib/mdb/proc/rad.so
 dir path=usr/lib/rad
 dir path=usr/lib/rad/java
 file path=usr/lib/rad/java/adr.jar
@@ -84,11 +84,21 @@
 dir path=usr/share/lib group=sys facet.devel=true
 dir path=usr/share/lib/xml group=sys facet.devel=true
 dir path=usr/share/lib/xml/rng group=sys facet.devel=true
-file path=usr/share/lib/xml/rng/adr.rng.1 facet.devel=true
-file path=usr/share/lib/xml/rng/ADRdoc.rng facet.devel=true
+file path=usr/share/lib/xml/rng/radadr-doc.rng facet.devel=true
+file path=usr/share/lib/xml/rng/radadr.rng.1 facet.devel=true
+dir path=usr/share/lib/xml/style group=sys facet.devel=true
+dir path=usr/share/lib/xml/style/locale group=sys facet.devel=true
+file path=usr/share/lib/xml/style/locale.xsl facet.devel=true
+file path=usr/share/lib/xml/style/locale/radadr-strings.xml facet.devel=true
+file path=usr/share/lib/xml/style/radadr-docbook-common.xsl facet.devel=true
+file path=usr/share/lib/xml/style/radadr-docbook.xsl facet.devel=true
+file path=usr/share/lib/xml/style/radadr-docbook-man.xsl facet.devel=true
+file path=usr/share/lib/xml/style/radadr-rmdoc.xsl facet.devel=true
 dir path=usr/share/man
 dir path=usr/share/man/man1 facet.devel=true
 file path=usr/share/man/man1/radadrgen.1 facet.devel=true
 dir path=usr/share/man/man1m facet.doc.man=true
 file path=usr/share/man/man1m/rad.1m facet.doc.man=true
 depend fmri=pkg:/runtime/java/jre-6 type=require facet.devel=true
+depend fmri=pkg:/library/libxml2 type=require facet.devel=true
+depend fmri=pkg:/data/docbook/docbook-style-xsl type=require facet.devel=true
--- a/usr/src/test/java/Makefile	Wed Mar 14 04:47:00 2012 -0700
+++ b/usr/src/test/java/Makefile	Wed Mar 14 10:45:15 2012 -0400
@@ -52,7 +52,10 @@
 
 all:
 	mkdir -p $(GEN)
-	$(RADADRGEN) -j $(GEN) -i $(APIS)
+	for f in $(APIS); \
+	do \
+		$(RADADRGEN) -j $(GEN) -i "$$f"; \
+	done
 	$(JAVAC) $(JAVA_OPTS) `find $(JSRC) $(GEN) -name '*.java'`
 
 test: