Skip to content

Instantly share code, notes, and snippets.

@boenrobot
Created September 6, 2011 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boenrobot/1197590 to your computer and use it in GitHub Desktop.
Save boenrobot/1197590 to your computer and use it in GitHub Desktop.
First attempt at an XML Schema for docblox's configuration file
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="docblox">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">Root element of docblox's configuration.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:all>
<xsd:element name="title">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">Tthe title for this project, may contain HTML.</xsd:documentation>
</xsd:annotation>
<xsd:complexType mixed="true">
<xsd:sequence>
<xsd:any minOccurs="0" maxOccurs="unbounded" namespace="http://www.w3.org/1999/xhtml" processContents="lax"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="parser" minOccurs="0">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">The parser section contains all settings related to the conversion of your project’s source to the intermediate structure format of DocBlox (structure.xml).</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:all>
<xsd:element name="default-package-name" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">Optional element which defines the name of the default package. This is the name of the package when none is provided.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="target" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">The target location where to store the structure.xml, also used as source location for the transformer.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="markers" minOccurs="0">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">Contains a listing of item’s. These items identify which keywords in comments are used to identify additional sets of information. An example of this is inline comments starting with the <em>marker</em> TODO or FIXME.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="extensions" minOccurs="0">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">Contains a list of extension’s which a file must have to be interpreted. If a file does not have the extension mentioned in this list then it is not parsed. Examples: php, php3 or phtml.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="extension" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="visibility" minOccurs="0" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:element name="transformer" minOccurs="0">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">The transformer section contains most settings related to the transformation of the intermediate structure format (structure.xml) to a human-readable set of documentation. The format of this set of documentation is determined by the template choice which is present in the <strong>transformations</strong> head section.
<blockquote>The transformer determines the location of the intermediate structure format (structure.xml) by retrieving the <strong>target</strong> element in the <strong>parser</strong> section.</blockquote>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="target" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">The target location where to store the generated documentation files.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="external-class-documentation" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">With this element you can link the documentation generated by DocBlox to the URL of a library based on the prefix of the class. This element may be used multiple times and each time has a <strong>prefix</strong> and <strong>uri</strong> element which specify which class to link where. The uri element supports 2 substitution variables: {CLASS} and {LOWERCASE_CLASS}.
<blockquote>Please note that if the class is part of a namespace that the backslashes are also copied; with exception of the ‘root’ (start of the class name).</blockquote>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:all>
<xsd:element name="prefix" type="xsd:string"/>
<xsd:element name="uri" type="xsd:anyURI"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="logging" minOccurs="0">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">The logging section contains all settings related to the logging of information in DocBlox.
<blockquote>DocBlox does not ‘care’ whether the specified logging paths exist; if they do not then no log files are generated.</blockquote>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:all>
<xsd:element name="level" type="logging-level">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">Determines the minimum level of information that is supplied. Any priority equal to or higher than the given is included in the log files and is output to the screen. All priorities lower than the given are not logged.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="paths">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">Contains all folders to where DocBlox may log.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:all>
<xsd:element name="default">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">The path of the default logging file, the name may be augmented with a {DATE} variable to provide a timestamp and {APP_ROOT} to indicate the root of the DocBlox application.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="errors">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">Messages with level debug are not added to the default log but in a separate log file whose path you can declare here. As with the default log file you can augment the path with the {DATE} variable.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:element name="transformations" minOccurs="0">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">The transformations section controls the behaviour applied in transforming the intermediate structure format to the final human-readable output.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="template">
<xsd:annotation>
<xsd:documentation>The name or path of a template to use. This element may be used multiple times to combine several templates though usually you only supply one.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:attribute name="name" use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="transformation">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">It is also possible to execute additional transformations specifically for this project by defining your own transformations here.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
<xsd:element name="files" minOccurs="0">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">The files section allows you to specify where the source code for your project is and what files to ignore. It is allowed to use relative paths here; just remember that these are relative from the working directory where you execute DocBlox in.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="file">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">It is possible to specify specific <strong>file</strong>s or a specific set of files using the element. As with the -f parameter it supports wildcards.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="directory">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">In addition you can also provide entire directory trees using the element. This also supports the use of wildcards. Please note that in contrary to the element that the element is recursive and will tell DocBlox to process all files contained in this folder and every subfolder.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="ignore">
<xsd:annotation>
<xsd:documentation xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">In some cases you will have to <strong>ignore</strong> certain files in your project; examples of these can be third party libraries and/or tests. In this case you can use the ignore element and provide a pattern (not a path) to ignore. This if you provide <strong>*test*</strong> it will ignore any file or directory containing the text <em>test</em> in it.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="logging-level">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="emerg"/>
<xsd:enumeration value="alert"/>
<xsd:enumeration value="crit"/>
<xsd:enumeration value="err"/>
<xsd:enumeration value="warn"/>
<xsd:enumeration value="notice"/>
<xsd:enumeration value="info"/>
<xsd:enumeration value="debug"/>
<xsd:enumeration value="quiet"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment