[jatl] 02/03: Imported Upstream version 0.2.2

Emmanuel Bourg ebourg-guest at alioth.debian.org
Thu Oct 3 07:28:47 UTC 2013


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository jatl.

commit b2fa5c9076ef2109cd75880037ba0223179b981f
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Thu Oct 3 09:24:53 2013 +0200

    Imported Upstream version 0.2.2
---
 COPYING                                            |  177 ++
 pom.xml                                            |  367 +++
 src/etc/header.txt                                 |   13 +
 src/etc/xhtml1-transitional.xsd                    | 2755 ++++++++++++++++++++
 src/etc/xhtml2java.groovy                          |  136 +
 .../com/googlecode/jatl/GeneratedHtmlBuilder.java  | 2309 ++++++++++++++++
 src/main/java/com/googlecode/jatl/Html.java        |   80 +
 src/main/java/com/googlecode/jatl/HtmlBuilder.java |   79 +
 src/main/java/com/googlecode/jatl/HtmlWriter.java  |   73 +
 src/main/java/com/googlecode/jatl/Indenter.java    |   81 +
 .../java/com/googlecode/jatl/MarkupBuilder.java    |  828 ++++++
 .../com/googlecode/jatl/MarkupBuilderWriter.java   |   44 +
 src/main/java/com/googlecode/jatl/MarkupUtils.java |  171 ++
 .../java/com/googlecode/jatl/MarkupWriter.java     |   68 +
 .../java/com/googlecode/jatl/SimpleIndenter.java   |   81 +
 .../java/com/googlecode/jatl/package-info.java     |   49 +
 .../com/googlecode/jatl/CustomHtmlBuilderTest.java |   92 +
 .../java/com/googlecode/jatl/HtmlBuilderTest.java  |  642 +++++
 .../java/com/googlecode/jatl/HtmlWriterTest.java   |  107 +
 19 files changed, 8152 insertions(+)

diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..4947287
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,177 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..458ee5e
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,367 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>com.googlecode.jatl</groupId>
+  <artifactId>jatl</artifactId>
+  <version>0.2.2</version>
+  <packaging>jar</packaging>
+
+  <name>jatl</name>
+  <description>Is an extremely lightweight efficient Java library 
+  to generate XHTML or XML in a micro DSL builder/fluent style.
+  </description>
+  <url>http://maven.apache.org</url>
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <project.domain>jatl.googlecode.com</project.domain>
+    <project.site.domain>site.jatl.googlecode.com</project.site.domain>
+    <project.maven.domain>m2.jatl.googlecode.com</project.maven.domain>
+    <project.scm>https://${project.domain}/hg/</project.scm>
+    <project.site.scm>https://${project.site.domain}/hg</project.site.scm>
+    <project.maven.scm>https://${project.maven.domain}/hg</project.maven.scm>
+  </properties>
+  <parent>
+    <groupId>org.sonatype.oss</groupId>
+    <artifactId>oss-parent</artifactId>
+    <version>5</version>
+  </parent>
+  <scm>
+    <connection>scm:hg:https://jatl.googlecode.com/hg/</connection>
+    <developerConnection>scm:hg:https://jatl.googlecode.com/hg/</developerConnection>
+    <url>https://jatl.googlecode.com/hg/</url>
+  </scm>
+  <inceptionYear>2010</inceptionYear>
+    <licenses>
+      <license>
+         <name>The Apache Software License, Version 2.0</name>
+         <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+         <distribution>repo</distribution>
+         <comments>
+            This product includes software developed by Adam Gent (http://www.adamgent.com).
+         </comments>
+      </license>
+    </licenses>
+   <organization>
+      <name>JATL</name>
+      <url>http://jatl.google.com</url>
+   </organization>
+
+   <issueManagement>
+      <system>googlecode</system>
+      <url>http://code.google.com/p/jatl/issues/list</url>
+   </issueManagement>
+
+   <developers>
+      <developer>
+         <name>Adam Gent</name>
+         <email>adam dot gent at evocatus dot com</email>
+         <roles>
+            <role>Original source code developer</role>
+         </roles>
+      </developer>
+   </developers>
+   
+    <profiles>
+        <profile>
+            <id>release-sign-artifacts</id>
+            <activation>
+                <property>
+                    <name>performRelease</name>
+                    <value>true</value>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-gpg-plugin</artifactId>
+                        <version>1.1</version>
+                        <executions>
+                            <execution>
+                                <id>sign-artifacts</id>
+                                <phase>verify</phase>
+                                <goals>
+                                    <goal>sign</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+    <build>
+		<extensions>
+			<extension>
+				<groupId>org.apache.maven.wagon</groupId>
+				<artifactId>wagon-scm</artifactId>
+				<version>1.0-beta-6</version>
+			</extension>
+			<extension>
+				<groupId>org.apache.maven.scm</groupId>
+				<artifactId>maven-scm-provider-hg</artifactId>
+				<version>1.0</version>
+			</extension>
+            <extension>
+                <groupId>org.apache.maven.scm</groupId>
+                <artifactId>maven-scm-manager-plexus</artifactId>
+                <version>1.0</version>
+            </extension>
+		</extensions>
+       <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>com.googlecode.maven-gcu-plugin</groupId>
+                    <artifactId>maven-gcu-plugin</artifactId>
+                    <version>1.0</version>
+                </plugin>
+                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+                <plugin>
+                	<groupId>org.eclipse.m2e</groupId>
+                	<artifactId>lifecycle-mapping</artifactId>
+                	<version>1.0.0</version>
+                	<configuration>
+                		<lifecycleMappingMetadata>
+                			<pluginExecutions>
+                				<pluginExecution>
+                					<pluginExecutionFilter>
+                						<groupId>
+                							org.apache.maven.plugins
+                						</groupId>
+                						<artifactId>
+                							maven-enforcer-plugin
+                						</artifactId>
+                						<versionRange>
+                							[1.0-beta-1,)
+                						</versionRange>
+                						<goals>
+                							<goal>display-info</goal>
+                						</goals>
+                					</pluginExecutionFilter>
+                					<action>
+                						<ignore />
+                					</action>
+                				</pluginExecution>
+                				<pluginExecution>
+                					<pluginExecutionFilter>
+                						<groupId>
+                							org.apache.felix
+                						</groupId>
+                						<artifactId>
+                							maven-bundle-plugin
+                						</artifactId>
+                						<versionRange>
+                							[2.3.5,)
+                						</versionRange>
+                						<goals>
+                							<goal>manifest</goal>
+                						</goals>
+                					</pluginExecutionFilter>
+                					<action>
+                						<ignore />
+                					</action>
+                				</pluginExecution>
+                			</pluginExecutions>
+                		</lifecycleMappingMetadata>
+                	</configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-release-plugin</artifactId>
+            </plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-scm-plugin</artifactId>
+				<version>1.4</version>
+				<configuration>
+					<connectionType>connection</connectionType>
+				</configuration>
+			</plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-enforcer-plugin</artifactId>
+                <version>1.0-beta-1</version>
+                <executions>
+                    <execution>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>display-info</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>com.mycila.maven-license-plugin</groupId>
+                <artifactId>maven-license-plugin</artifactId>
+                <configuration>
+                    <basedir>${basedir}</basedir>
+                    <header>${basedir}/src/etc/header.txt</header>
+                    <quiet>false</quiet>
+                    <failIfMissing>true</failIfMissing>
+                    <aggregate>false</aggregate>
+                    <includes>
+                        <include>src/**</include>
+                        <include>**/test/**</include>
+                    </includes>
+                    <excludes>
+                        <exclude>src/etc/xhtml1-transitional.xsd</exclude>
+                        <exclude>target/**</exclude>
+                        <exclude>.clover/**</exclude>
+                    </excludes>
+                    <useDefaultExcludes>true</useDefaultExcludes>
+                    <mapping>
+                        <jwc>XML_STYLE</jwc>
+                        <application>XML_STYLE</application>
+                        <myFileExtension>JAVADOC_STYLE</myFileExtension>
+                    </mapping>
+                    <useDefaultMapping>true</useDefaultMapping>
+                    <properties>
+                        <name>the original author or authors</name>
+                        <year>2012</year>
+                    </properties>
+                    <encoding>UTF-8</encoding>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <configuration>
+                    <aggregate>true</aggregate>
+                    <links>
+                        <link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
+                    </links>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>attach-javadocs</id>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>com.googlecode.maven-gcu-plugin</groupId>
+                <artifactId>maven-gcu-plugin</artifactId>
+                <version>1.0</version>
+                <configuration>
+                    <serverId>googlecode</serverId> <!-- default: googlecode -->
+                    <failsOnError>true</failsOnError> <!-- default: false -->
+                    <projectName>jatl</projectName> <!-- default: ${project.artifactId} -->
+                    <uploads>
+                        <upload>
+                            <file>${project.build.directory}/${project.artifactId}-${project.version}.${project.packaging}</file>
+                            <summary>${project.name} sources bundle ${project.version}</summary>
+                            <labels>
+                                <label>Featured</label>
+                                <label>Type-Archive</label>
+                            </labels>
+                        </upload>
+                        <upload>
+                            <file>${project.build.directory}/${project.artifactId}-${project.version}-sources.${project.packaging}</file>
+                            <summary>${project.name} sources bundle ${project.version}</summary>
+                            <labels>
+                                <label>Featured</label>
+                                <label>Type-Archive</label>
+                            </labels>
+                        </upload>
+                        <upload>
+                            <file>${project.build.directory}/${project.artifactId}-${project.version}-javadoc.${project.packaging}</file>
+                            <summary>${project.name} sources bundle ${project.version}</summary>
+                            <labels>
+                                <label>Featured</label>
+                                <label>Type-Archive</label>
+                            </labels>
+                        </upload>
+                    </uploads>
+                </configuration>
+            </plugin>
+            <plugin>
+            	<groupId>org.apache.felix</groupId>
+            	<artifactId>maven-bundle-plugin</artifactId>
+            	<version>2.3.5</version>
+            	<extensions>true</extensions>
+				<executions>
+					<execution>
+						<id>bundle-manifest</id>
+						<phase>process-classes</phase>
+						<goals>    
+							<goal>manifest</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+			<artifactId>maven-jar-plugin</artifactId>
+				<version>2.3.1</version>
+				<configuration>
+					<archive>  
+						<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+					</archive> 
+				</configuration>
+  			</plugin>
+        </plugins>
+    </build>
+    <reporting>
+    	<plugins>
+    		<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-javadoc-plugin</artifactId>
+				<version>2.7</version>
+				<reportSets>
+					<reportSet>
+						<reports>
+							<report>javadoc</report>
+						</reports>
+					</reportSet>
+				</reportSets>
+    		</plugin>
+    	</plugins>
+    </reporting>
+  
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+    	<groupId>commons-lang</groupId>
+    	<artifactId>commons-lang</artifactId>
+    	<version>2.5</version>
+    	<type>jar</type>
+    	<scope>compile</scope>
+    </dependency>
+  </dependencies>
+  
+</project>
diff --git a/src/etc/header.txt b/src/etc/header.txt
new file mode 100644
index 0000000..d806287
--- /dev/null
+++ b/src/etc/header.txt
@@ -0,0 +1,13 @@
+Copyright (C) ${year} ${name}.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
\ No newline at end of file
diff --git a/src/etc/xhtml1-transitional.xsd b/src/etc/xhtml1-transitional.xsd
new file mode 100644
index 0000000..8ce44fb
--- /dev/null
+++ b/src/etc/xhtml1-transitional.xsd
@@ -0,0 +1,2755 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema version="1.0" xml:lang="en"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://www.w3.org/1999/xhtml"
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:xml="http://www.w3.org/XML/1998/namespace"
+    elementFormDefault="qualified">
+
+  <xs:annotation>
+    <xs:documentation>
+    XHTML 1.0 (Second Edition) Transitional in XML Schema
+
+    This is the same as HTML 4 Transitional except for
+    changes due to the differences between XML and SGML.
+
+    Namespace = http://www.w3.org/1999/xhtml
+
+    For further information, see: http://www.w3.org/TR/xhtml1
+
+    Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),
+    All Rights Reserved. 
+
+    The DTD version is identified by the PUBLIC and SYSTEM identifiers:
+
+    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+
+    $Id: xhtml1-transitional.xsd,v 1.5 2002/08/28 09:53:29 mimasa Exp $
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:import namespace="http://www.w3.org/XML/1998/namespace"
+      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Character mnemonic entities =========================
+
+    XHTML entity sets are identified by the PUBLIC and SYSTEM identifiers:
+  
+    PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent"
+
+    PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent"
+
+    PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent"
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Imported Names ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="ContentType">
+    <xs:annotation>
+      <xs:documentation>
+      media type, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="ContentTypes">
+    <xs:annotation>
+      <xs:documentation>
+      comma-separated list of media types, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Charset">
+    <xs:annotation>
+      <xs:documentation>
+      a character encoding, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Charsets">
+    <xs:annotation>
+      <xs:documentation>
+      a space separated list of character encodings, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="LanguageCode">
+    <xs:annotation>
+      <xs:documentation>
+      a language code, as per [RFC3066]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:language"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Character">
+    <xs:annotation>
+      <xs:documentation>
+      a single character, as per section 2.2 of [XML]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:length value="1" fixed="true"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Number">
+    <xs:annotation>
+      <xs:documentation>
+      one or more digits
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger">
+      <xs:pattern value="[0-9]+"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="tabindexNumber">
+    <xs:annotation>
+      <xs:documentation>
+      tabindex attribute specifies the position of the current element
+      in the tabbing order for the current document. This value must be
+      a number between 0 and 32767. User agents should ignore leading zeros. 
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="Number">
+      <xs:minInclusive value="0"/>
+      <xs:maxInclusive value="32767"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="LinkTypes">
+    <xs:annotation>
+      <xs:documentation>
+      space-separated list of link types
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:NMTOKENS"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="MediaDesc">
+    <xs:annotation>
+      <xs:documentation>
+      single or comma-separated list of media descriptors
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[^,]+(,\s*[^,]+)*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="URI">
+    <xs:annotation>
+      <xs:documentation>
+      a Uniform Resource Identifier, see [RFC2396]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:anyURI"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="UriList">
+    <xs:annotation>
+      <xs:documentation>
+      a space separated list of Uniform Resource Identifiers
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Datetime">
+    <xs:annotation>
+      <xs:documentation>
+      date and time information. ISO date format
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:dateTime"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Script">
+    <xs:annotation>
+      <xs:documentation>
+      script expression
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="StyleSheet">
+    <xs:annotation>
+      <xs:documentation>
+      style sheet data
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Text">
+    <xs:annotation>
+      <xs:documentation>
+      used for titles etc.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="FrameTarget">
+    <xs:annotation>
+      <xs:documentation>
+      render in this frame
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:NMTOKEN">
+      <xs:pattern value="_(blank|self|parent|top)|[A-Za-z]\c*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Length">
+    <xs:annotation>
+      <xs:documentation>
+      nn for pixels or nn% for percentage length
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[-+]?(\d+|\d+(\.\d+)?%)"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="MultiLength">
+    <xs:annotation>
+      <xs:documentation>
+      pixel, percentage, or relative
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Pixels">
+    <xs:annotation>
+      <xs:documentation>
+      integer representing length in pixels
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger"/>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    these are used for image maps
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="Shape">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="rect"/>
+      <xs:enumeration value="circle"/>
+      <xs:enumeration value="poly"/>
+      <xs:enumeration value="default"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Coords">
+    <xs:annotation>
+      <xs:documentation>
+      comma separated list of lengths
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern
+          value="[-+]?(\d+|\d+(\.\d+)?%)(,\s*[-+]?(\d+|\d+(\.\d+)?%))*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="ImgAlign">
+    <xs:annotation>
+      <xs:documentation>
+      used for object, applet, img, input and iframe
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="top"/>
+      <xs:enumeration value="middle"/>
+      <xs:enumeration value="bottom"/>
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Color">
+    <xs:annotation>
+      <xs:documentation>
+      a color using sRGB: #RRGGBB as Hex values
+
+      There are also 16 widely known color names with their sRGB values:
+
+      Black  = #000000    Green  = #008000
+      Silver = #C0C0C0    Lime   = #00FF00
+      Gray   = #808080    Olive  = #808000
+      White  = #FFFFFF    Yellow = #FFFF00
+      Maroon = #800000    Navy   = #000080
+      Red    = #FF0000    Blue   = #0000FF
+      Purple = #800080    Teal   = #008080
+      Fuchsia= #FF00FF    Aqua   = #00FFFF
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[A-Za-z]+|#[0-9A-Fa-f]{3}|#[0-9A-Fa-f]{6}"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Generic Attributes ===============================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:attributeGroup name="coreattrs">
+    <xs:annotation>
+      <xs:documentation>
+      core attributes common to most elements
+      id       document-wide unique id
+      class    space separated list of classes
+      style    associated style info
+      title    advisory title/amplification
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="id" type="xs:ID"/>
+    <xs:attribute name="class" type="xs:NMTOKENS"/>
+    <xs:attribute name="style" type="StyleSheet"/>
+    <xs:attribute name="title" type="Text"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="i18n">
+    <xs:annotation>
+      <xs:documentation>
+      internationalization attributes
+      lang        language code (backwards compatible)
+      xml:lang    language code (as per XML 1.0 spec)
+      dir         direction for weak/neutral text
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="lang" type="LanguageCode"/>
+    <xs:attribute ref="xml:lang"/>
+    <xs:attribute name="dir">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="ltr"/>
+          <xs:enumeration value="rtl"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="events">
+    <xs:annotation>
+      <xs:documentation>
+      attributes for common UI events
+      onclick     a pointer button was clicked
+      ondblclick  a pointer button was double clicked
+      onmousedown a pointer button was pressed down
+      onmouseup   a pointer button was released
+      onmousemove a pointer was moved onto the element
+      onmouseout  a pointer was moved away from the element
+      onkeypress  a key was pressed and released
+      onkeydown   a key was pressed down
+      onkeyup     a key was released
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="onclick" type="Script"/>
+    <xs:attribute name="ondblclick" type="Script"/>
+    <xs:attribute name="onmousedown" type="Script"/>
+    <xs:attribute name="onmouseup" type="Script"/>
+    <xs:attribute name="onmouseover" type="Script"/>
+    <xs:attribute name="onmousemove" type="Script"/>
+    <xs:attribute name="onmouseout" type="Script"/>
+    <xs:attribute name="onkeypress" type="Script"/>
+    <xs:attribute name="onkeydown" type="Script"/>
+    <xs:attribute name="onkeyup" type="Script"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="focus">
+    <xs:annotation>
+      <xs:documentation>
+      attributes for elements that can get the focus
+      accesskey   accessibility key character
+      tabindex    position in tabbing order
+      onfocus     the element got the focus
+      onblur      the element lost the focus
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="accesskey" type="Character"/>
+    <xs:attribute name="tabindex" type="tabindexNumber"/>
+    <xs:attribute name="onfocus" type="Script"/>
+    <xs:attribute name="onblur" type="Script"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="attrs">
+    <xs:attributeGroup ref="coreattrs"/>
+    <xs:attributeGroup ref="i18n"/>
+    <xs:attributeGroup ref="events"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="TextAlign">
+    <xs:annotation>
+      <xs:documentation>
+      text alignment for p, div, h1-h6. The default is
+      align="left" for ltr headings, "right" for rtl
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="align">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="left"/>
+          <xs:enumeration value="center"/>
+          <xs:enumeration value="right"/>
+          <xs:enumeration value="justify"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Text Elements ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="special.extra">
+    <xs:choice>
+      <xs:element ref="object"/>
+      <xs:element ref="applet"/>
+      <xs:element ref="img"/>
+      <xs:element ref="map"/>
+      <xs:element ref="iframe"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="special.basic">
+    <xs:choice>
+      <xs:element ref="br"/>
+      <xs:element ref="span"/>
+      <xs:element ref="bdo"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="special">
+    <xs:choice>
+      <xs:group ref="special.basic"/>
+      <xs:group ref="special.extra"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="fontstyle.extra">
+    <xs:choice>
+      <xs:element ref="big"/>
+      <xs:element ref="small"/>
+      <xs:element ref="font"/>
+      <xs:element ref="basefont"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="fontstyle.basic">
+    <xs:choice>
+      <xs:element ref="tt"/>
+      <xs:element ref="i"/>
+      <xs:element ref="b"/>
+      <xs:element ref="u"/>
+      <xs:element ref="s"/>
+      <xs:element ref="strike"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="fontstyle">
+    <xs:choice>
+      <xs:group ref="fontstyle.basic"/>
+      <xs:group ref="fontstyle.extra"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="phrase.extra">
+    <xs:choice>
+      <xs:element ref="sub"/>
+      <xs:element ref="sup"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="phrase.basic">
+    <xs:choice>
+      <xs:element ref="em"/>
+      <xs:element ref="strong"/>
+      <xs:element ref="dfn"/>
+      <xs:element ref="code"/>
+      <xs:element ref="q"/>
+      <xs:element ref="samp"/>
+      <xs:element ref="kbd"/>
+      <xs:element ref="var"/>
+      <xs:element ref="cite"/>
+      <xs:element ref="abbr"/>
+      <xs:element ref="acronym"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="phrase">
+    <xs:choice>
+      <xs:group ref="phrase.basic"/>
+      <xs:group ref="phrase.extra"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="inline.forms">
+    <xs:choice>
+      <xs:element ref="input"/>
+      <xs:element ref="select"/>
+      <xs:element ref="textarea"/>
+      <xs:element ref="label"/>
+      <xs:element ref="button"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="misc.inline">
+    <xs:annotation>
+      <xs:documentation>
+      these can only occur at block level
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice>
+      <xs:element ref="ins"/>
+      <xs:element ref="del"/>
+      <xs:element ref="script"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="misc">
+    <xs:annotation>
+      <xs:documentation>
+      these can only occur at block level
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice>
+      <xs:element ref="noscript"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="inline">
+    <xs:choice>
+      <xs:element ref="a"/>
+      <xs:group ref="special"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="inline.forms"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:complexType name="Inline" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      "Inline" covers inline or "text-level" element
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="inline"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Block level elements ==============================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="heading">
+    <xs:choice>
+      <xs:element ref="h1"/>
+      <xs:element ref="h2"/>
+      <xs:element ref="h3"/>
+      <xs:element ref="h4"/>
+      <xs:element ref="h5"/>
+      <xs:element ref="h6"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="lists">
+    <xs:choice>
+      <xs:element ref="ul"/>
+      <xs:element ref="ol"/>
+      <xs:element ref="dl"/>
+      <xs:element ref="menu"/>
+      <xs:element ref="dir"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="blocktext">
+    <xs:choice>
+      <xs:element ref="pre"/>
+      <xs:element ref="hr"/>
+      <xs:element ref="blockquote"/>
+      <xs:element ref="address"/>
+      <xs:element ref="center"/>
+      <xs:element ref="noframes"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="block">
+    <xs:choice>
+      <xs:element ref="p"/>
+      <xs:group ref="heading"/>
+      <xs:element ref="div"/>
+      <xs:group ref="lists"/>
+      <xs:group ref="blocktext"/>
+      <xs:element ref="isindex"/>
+      <xs:element ref="fieldset"/>
+      <xs:element ref="table"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:complexType name="Flow" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      "Flow" mixes block and inline and is used for list items etc.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="block"/>
+      <xs:element ref="form"/>
+      <xs:group ref="inline"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Content models for exclusions =====================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:complexType name="a.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      a elements use "Inline" excluding a
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="special"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="inline.forms"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="pre.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      pre uses "Inline" excluding img, object, applet, big, small,
+      font, or basefont
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="a"/>
+      <xs:group ref="special.basic"/>
+      <xs:group ref="fontstyle.basic"/>
+      <xs:group ref="phrase.basic"/>
+      <xs:group ref="inline.forms"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="form.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      form uses "Flow" excluding form
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="block"/>
+      <xs:group ref="inline"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="button.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      button uses "Flow" but excludes a, form, form controls, iframe
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="p"/>
+      <xs:group ref="heading"/>
+      <xs:element ref="div"/>
+      <xs:group ref="lists"/>
+      <xs:group ref="blocktext"/>
+      <xs:element ref="table"/>
+      <xs:element ref="br"/>
+      <xs:element ref="span"/>
+      <xs:element ref="bdo"/>
+      <xs:element ref="object"/>
+      <xs:element ref="applet"/>
+      <xs:element ref="img"/>
+      <xs:element ref="map"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Document Structure ==================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="html">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="head"/>
+        <xs:element ref="body"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Document Head =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="head.misc">
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="script"/>
+        <xs:element ref="style"/>
+        <xs:element ref="meta"/>
+        <xs:element ref="link"/>
+        <xs:element ref="object"/>
+        <xs:element ref="isindex"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:group>
+
+  <xs:element name="head">
+    <xs:annotation>
+      <xs:documentation>
+      content model is "head.misc" combined with a single
+      title and an optional base element in any order
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="head.misc"/>
+        <xs:choice>
+          <xs:sequence>
+            <xs:element ref="title"/>
+            <xs:group ref="head.misc"/>
+            <xs:sequence minOccurs="0">
+              <xs:element ref="base"/>
+              <xs:group ref="head.misc"/>
+            </xs:sequence>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element ref="base"/>
+            <xs:group ref="head.misc"/>
+            <xs:element ref="title"/>
+            <xs:group ref="head.misc"/>
+          </xs:sequence>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="profile" type="URI"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="title">
+    <xs:annotation>
+      <xs:documentation>
+      The title element is not considered part of the flow of text.
+      It should be displayed, for example as the page header or
+      window title. Exactly one title is required per document.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="base">
+    <xs:annotation>
+      <xs:documentation>
+      document base URI
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="target" type="FrameTarget"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="meta">
+    <xs:annotation>
+      <xs:documentation>
+      generic metainformation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="http-equiv"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="content" use="required"/>
+      <xs:attribute name="scheme"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="link">
+    <xs:annotation>
+      <xs:documentation>
+      Relationship values can be used in principle:
+
+      a) for document specific toolbars/menus when used
+         with the link element in document head e.g.
+           start, contents, previous, next, index, end, help
+      b) to link to a separate style sheet (rel="stylesheet")
+      c) to make a link to a script (rel="script")
+      d) by stylesheets to control how collections of
+         html nodes are rendered into printed documents
+      e) to make a link to a printable version of this document
+         e.g. a PostScript or PDF version (rel="alternate" media="print")
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="charset" type="Charset"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="hreflang" type="LanguageCode"/>
+      <xs:attribute name="type" type="ContentType"/>
+      <xs:attribute name="rel" type="LinkTypes"/>
+      <xs:attribute name="rev" type="LinkTypes"/>
+      <xs:attribute name="media" type="MediaDesc"/>
+      <xs:attribute name="target" type="FrameTarget"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="style">
+    <xs:annotation>
+      <xs:documentation>
+      style info, which may include CDATA sections
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="type" use="required" type="ContentType"/>
+      <xs:attribute name="media" type="MediaDesc"/>
+      <xs:attribute name="title" type="Text"/>
+      <xs:attribute ref="xml:space" fixed="preserve"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="script">
+    <xs:annotation>
+      <xs:documentation>
+      script statements, which may include CDATA sections
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="charset" type="Charset"/>
+      <xs:attribute name="type" use="required" type="ContentType"/>
+      <xs:attribute name="language"/>
+      <xs:attribute name="src" type="URI"/>
+      <xs:attribute name="defer">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="defer"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute ref="xml:space" fixed="preserve"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="noscript">
+    <xs:annotation>
+      <xs:documentation>
+      alternate content container for non script-based rendering
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ======================= Frames =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="iframe">
+    <xs:annotation>
+      <xs:documentation>
+      inline subwindow
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="coreattrs"/>
+          <xs:attribute name="longdesc" type="URI"/>
+          <xs:attribute name="name" type="xs:NMTOKEN"/>
+          <xs:attribute name="src" type="URI"/>
+          <xs:attribute name="frameborder" default="1">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="1"/>
+                <xs:enumeration value="0"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="marginwidth" type="Pixels"/>
+          <xs:attribute name="marginheight" type="Pixels"/>
+          <xs:attribute name="scrolling" default="auto">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="yes"/>
+                <xs:enumeration value="no"/>
+                <xs:enumeration value="auto"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="align" type="ImgAlign"/>
+          <xs:attribute name="height" type="Length"/>
+          <xs:attribute name="width" type="Length"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="noframes">
+    <xs:annotation>
+      <xs:documentation>
+      alternate content container for non frame-based rendering
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Document Body ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="body">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="onload" type="Script"/>
+          <xs:attribute name="onunload" type="Script"/>
+          <xs:attribute name="background" type="URI"/>
+          <xs:attribute name="bgcolor" type="Color"/>
+          <xs:attribute name="text" type="Color"/>
+          <xs:attribute name="link" type="Color"/>
+          <xs:attribute name="vlink" type="Color"/>
+          <xs:attribute name="alink" type="Color"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="div">
+    <xs:annotation>
+      <xs:documentation>
+      generic language/style container      
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Paragraphs =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="p">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Headings =========================================
+
+    There are six levels of headings from h1 (the most important)
+    to h6 (the least important).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="h1">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h2">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h3">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h4">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h5">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h6">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Lists ============================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="ULStyle">
+    <xs:annotation>
+      <xs:documentation>
+      Unordered list bullet styles
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="disc"/>
+      <xs:enumeration value="square"/>
+      <xs:enumeration value="circle"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="ul">
+    <xs:annotation>
+      <xs:documentation>
+      Unordered list
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="type" type="ULStyle"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="OLStyle">
+    <xs:annotation>
+      <xs:documentation>
+      Ordered list numbering style
+
+      1   arabic numbers      1, 2, 3, ...
+      a   lower alpha         a, b, c, ...
+      A   upper alpha         A, B, C, ...
+      i   lower roman         i, ii, iii, ...
+      I   upper roman         I, II, III, ...
+
+      The style is applied to the sequence number which by default
+      is reset to 1 for the first list item in an ordered list.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:element name="ol">
+    <xs:annotation>
+      <xs:documentation>
+      Ordered (numbered) list
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="type" type="OLStyle"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="start" type="Number"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="menu">
+    <xs:annotation>
+      <xs:documentation>
+      single column list (DEPRECATED)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dir">
+    <xs:annotation>
+      <xs:documentation>
+      multiple column list (DEPRECATED)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="LIStyle">
+    <xs:annotation>
+      <xs:documentation>
+      LIStyle is constrained to: "(ULStyle|OLStyle)"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:element name="li">
+    <xs:annotation>
+      <xs:documentation>
+      list item
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="type" type="LIStyle"/>
+          <xs:attribute name="value" type="Number"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    definition lists - dt for term, dd for its definition
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="dl">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="dt"/>
+        <xs:element ref="dd"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dt">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dd">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Address ==========================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="address">
+    <xs:annotation>
+      <xs:documentation>
+      information on author
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="inline"/>
+        <xs:group ref="misc.inline"/>
+        <xs:element ref="p"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Horizontal Rule ==================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="hr">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="noshade">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="noshade"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="size" type="Pixels"/>
+      <xs:attribute name="width" type="Length"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Preformatted Text ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="pre">
+    <xs:annotation>
+      <xs:documentation>
+      content is "Inline" excluding 
+         "img|object|applet|big|small|sub|sup|font|basefont"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="pre.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="width" type="Number"/>
+          <xs:attribute ref="xml:space" fixed="preserve"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Block-like Quotes ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="blockquote">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Text alignment ===================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="center">
+    <xs:annotation>
+      <xs:documentation>
+      center content
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Inserted/Deleted Text ============================
+
+    ins/del are allowed in block and inline content, but its
+    inappropriate to include block content within an ins element
+    occurring in inline content.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="ins">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+          <xs:attribute name="datetime" type="Datetime"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="del">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+          <xs:attribute name="datetime" type="Datetime"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== The Anchor Element ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="a">
+    <xs:annotation>
+      <xs:documentation>
+      content is "Inline" except that anchors shouldn't be nested
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="a.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="focus"/>
+          <xs:attribute name="charset" type="Charset"/>
+          <xs:attribute name="type" type="ContentType"/>
+          <xs:attribute name="name" type="xs:NMTOKEN"/>
+          <xs:attribute name="href" type="URI"/>
+          <xs:attribute name="hreflang" type="LanguageCode"/>
+          <xs:attribute name="rel" type="LinkTypes"/>
+          <xs:attribute name="rev" type="LinkTypes"/>
+          <xs:attribute name="shape" default="rect" type="Shape"/>
+          <xs:attribute name="coords" type="Coords"/>
+          <xs:attribute name="target" type="FrameTarget"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ===================== Inline Elements ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="span">
+    <xs:annotation>
+      <xs:documentation>
+      generic language/style container
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="bdo">
+    <xs:annotation>
+      <xs:documentation>
+      I18N BiDi over-ride
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="coreattrs"/>
+          <xs:attributeGroup ref="events"/>
+          <xs:attribute name="lang" type="LanguageCode"/>
+          <xs:attribute ref="xml:lang"/>
+          <xs:attribute name="dir" use="required">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="ltr"/>
+                <xs:enumeration value="rtl"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="br">
+    <xs:annotation>
+      <xs:documentation>
+      forced line break
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="coreattrs"/>
+      <xs:attribute name="clear" default="none">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="all"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="none"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="em">
+    <xs:annotation>
+      <xs:documentation>
+      emphasis
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="strong">
+    <xs:annotation>
+      <xs:documentation>
+      strong emphasis
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dfn">
+    <xs:annotation>
+      <xs:documentation>
+      definitional
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="code">
+    <xs:annotation>
+      <xs:documentation>
+      program code
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="samp">
+    <xs:annotation>
+      <xs:documentation>
+      sample
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="kbd">
+    <xs:annotation>
+      <xs:documentation>
+      something user would type
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="var">
+    <xs:annotation>
+      <xs:documentation>
+      variable
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="cite">
+    <xs:annotation>
+      <xs:documentation>
+      citation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="abbr">
+    <xs:annotation>
+      <xs:documentation>
+      abbreviation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="acronym">
+    <xs:annotation>
+      <xs:documentation>
+      acronym
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="q">
+    <xs:annotation>
+      <xs:documentation>
+      inlined quote
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="sub">
+    <xs:annotation>
+      <xs:documentation>
+      subscript
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="sup">
+    <xs:annotation>
+      <xs:documentation>
+      superscript
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tt">
+    <xs:annotation>
+      <xs:documentation>
+      fixed pitch font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="i">
+    <xs:annotation>
+      <xs:documentation>
+      italic font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="b">
+    <xs:annotation>
+      <xs:documentation>
+      bold font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="big">
+    <xs:annotation>
+      <xs:documentation>
+      bigger font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="small">
+    <xs:annotation>
+      <xs:documentation>
+      smaller font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="u">
+    <xs:annotation>
+      <xs:documentation>
+      underline
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="s">
+    <xs:annotation>
+      <xs:documentation>
+      strike-through
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="strike">
+    <xs:annotation>
+      <xs:documentation>
+      strike-through
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="basefont">
+    <xs:annotation>
+      <xs:documentation>
+      base font size
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="size" use="required"/>
+      <xs:attribute name="color" type="Color"/>
+      <xs:attribute name="face"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="font">
+    <xs:annotation>
+      <xs:documentation>
+      local change to font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="coreattrs"/>
+          <xs:attributeGroup ref="i18n"/>
+          <xs:attribute name="size"/>
+          <xs:attribute name="color" type="Color"/>
+          <xs:attribute name="face"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ==================== Object ======================================
+
+    object is used to embed objects as part of HTML pages.
+    param elements should precede other content. Parameters
+    can also be expressed as attribute/value pairs on the
+    object element itself when brevity is desired.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="object">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="param"/>
+        <xs:group ref="block"/>
+        <xs:element ref="form"/>
+        <xs:group ref="inline"/>
+        <xs:group ref="misc"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="declare">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="declare"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="classid" type="URI"/>
+      <xs:attribute name="codebase" type="URI"/>
+      <xs:attribute name="data" type="URI"/>
+      <xs:attribute name="type" type="ContentType"/>
+      <xs:attribute name="codetype" type="ContentType"/>
+      <xs:attribute name="archive" type="UriList"/>
+      <xs:attribute name="standby" type="Text"/>
+      <xs:attribute name="height" type="Length"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="usemap" type="URI"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+      <xs:attribute name="tabindex" type="Number"/>
+      <xs:attribute name="align" type="ImgAlign"/>
+      <xs:attribute name="border" type="Pixels"/>
+      <xs:attribute name="hspace" type="Pixels"/>
+      <xs:attribute name="vspace" type="Pixels"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="param">
+    <xs:annotation>
+      <xs:documentation>
+      param is used to supply a named property value.
+      In XML it would seem natural to follow RDF and support an
+      abbreviated syntax where the param elements are replaced
+      by attribute value pairs on the object start tag.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="value"/>
+      <xs:attribute name="valuetype" default="data">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="data"/>
+            <xs:enumeration value="ref"/>
+            <xs:enumeration value="object"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="type" type="ContentType"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Java applet ==================================
+
+    One of code or object attributes must be present.
+    Place param elements before other content.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="applet">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="param"/>
+        <xs:group ref="block"/>
+        <xs:element ref="form"/>
+        <xs:group ref="inline"/>
+        <xs:group ref="misc"/>
+      </xs:choice>
+      <xs:attributeGroup ref="coreattrs"/>
+      <xs:attribute name="codebase" type="URI"/>
+      <xs:attribute name="archive"/>
+      <xs:attribute name="code"/>
+      <xs:attribute name="object"/>
+      <xs:attribute name="alt" type="Text"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+      <xs:attribute name="width" use="required" type="Length"/>
+      <xs:attribute name="height" use="required" type="Length"/>
+      <xs:attribute name="align" type="ImgAlign"/>
+      <xs:attribute name="hspace" type="Pixels"/>
+      <xs:attribute name="vspace" type="Pixels"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Images ===========================================
+
+    To avoid accessibility problems for people who aren't
+    able to see the image, you should provide a text
+    description using the alt and longdesc attributes.
+    In addition, avoid the use of server-side image maps.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="img">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="src" use="required" type="URI"/>
+      <xs:attribute name="alt" use="required" type="Text"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+      <xs:attribute name="longdesc" type="URI"/>
+      <xs:attribute name="height" type="Length"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="usemap" type="URI">
+	<xs:annotation>
+	  <xs:documentation>
+          usemap points to a map element which may be in this document
+          or an external document, although the latter is not widely supported
+          </xs:documentation>
+	</xs:annotation>
+      </xs:attribute>
+      <xs:attribute name="ismap">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="ismap"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="align" type="ImgAlign"/>
+      <xs:attribute name="border" type="Length"/>
+      <xs:attribute name="hspace" type="Pixels"/>
+      <xs:attribute name="vspace" type="Pixels"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Client-side image maps ============================
+
+    These can be placed in the same document or grouped in a
+    separate document although this isn't yet widely supported
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="map">
+    <xs:complexType>
+      <xs:choice>
+        <xs:choice maxOccurs="unbounded">
+          <xs:group ref="block"/>
+          <xs:element ref="form"/>
+          <xs:group ref="misc"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="area"/>
+      </xs:choice>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attributeGroup ref="events"/>
+      <xs:attribute name="id" use="required" type="xs:ID"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style" type="StyleSheet"/>
+      <xs:attribute name="title" type="Text"/>
+      <xs:attribute name="name"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="area">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="shape" default="rect" type="Shape"/>
+      <xs:attribute name="coords" type="Coords"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="nohref">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="nohref"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="alt" use="required" type="Text"/>
+      <xs:attribute name="target" type="FrameTarget"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Forms ===============================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="form">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="form.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="action" use="required" type="URI"/>
+          <xs:attribute name="method" default="get">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="get"/>
+                <xs:enumeration value="post"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="enctype" type="ContentType"
+              default="application/x-www-form-urlencoded"/>
+          <xs:attribute name="onsubmit" type="Script"/>
+          <xs:attribute name="onreset" type="Script"/>
+          <xs:attribute name="accept" type="ContentTypes"/>
+          <xs:attribute name="accept-charset" type="Charsets"/>
+          <xs:attribute name="target" type="FrameTarget"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="label">
+    <xs:annotation>
+      <xs:documentation>
+      Each label must not contain more than ONE field
+      Label elements shouldn't be nested.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="for" type="xs:IDREF"/>
+          <xs:attribute name="accesskey" type="Character"/>
+          <xs:attribute name="onfocus" type="Script"/>
+          <xs:attribute name="onblur" type="Script"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="InputType">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="text"/>
+      <xs:enumeration value="password"/>
+      <xs:enumeration value="checkbox"/>
+      <xs:enumeration value="radio"/>
+      <xs:enumeration value="submit"/>
+      <xs:enumeration value="reset"/>
+      <xs:enumeration value="file"/>
+      <xs:enumeration value="hidden"/>
+      <xs:enumeration value="image"/>
+      <xs:enumeration value="button"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="input">
+    <xs:annotation>
+      <xs:documentation>
+      form control
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="type" default="text" type="InputType"/>
+      <xs:attribute name="name">
+	<xs:annotation>
+	  <xs:documentation>
+          the name attribute is required for all but submit & reset
+          </xs:documentation>
+	</xs:annotation>
+      </xs:attribute>
+      <xs:attribute name="value"/>
+      <xs:attribute name="checked">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="checked"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="readonly">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="readonly"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="size"/>
+      <xs:attribute name="maxlength" type="Number"/>
+      <xs:attribute name="src" type="URI"/>
+      <xs:attribute name="alt"/>
+      <xs:attribute name="usemap" type="URI"/>
+      <xs:attribute name="onselect" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+      <xs:attribute name="accept" type="ContentTypes"/>
+      <xs:attribute name="align" type="ImgAlign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="select">
+    <xs:annotation>
+      <xs:documentation>
+      option selector
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="optgroup"/>
+        <xs:element ref="option"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="size" type="Number"/>
+      <xs:attribute name="multiple">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="multiple"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="tabindex" type="tabindexNumber"/>
+      <xs:attribute name="onfocus" type="Script"/>
+      <xs:attribute name="onblur" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="optgroup">
+    <xs:annotation>
+      <xs:documentation>
+      option group
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="option"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="label" use="required" type="Text"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="option">
+    <xs:annotation>
+      <xs:documentation>
+      selectable choice
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="selected">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="selected"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="label" type="Text"/>
+      <xs:attribute name="value"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="textarea">
+    <xs:annotation>
+      <xs:documentation>
+      multi-line text field
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="rows" use="required" type="Number"/>
+      <xs:attribute name="cols" use="required" type="Number"/>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="readonly">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="readonly"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="onselect" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="fieldset">
+    <xs:annotation>
+      <xs:documentation>
+      The fieldset element is used to group form fields.
+      Only one legend element should occur in the content
+      and if present should only be preceded by whitespace.
+
+      NOTE: this content model is different from the XHTML 1.0 DTD,
+      closer to the intended content model in HTML4 DTD
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:sequence>
+        <xs:element ref="legend"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:group ref="block"/>
+          <xs:element ref="form"/>
+          <xs:group ref="inline"/>
+          <xs:group ref="misc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="LAlign">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="top"/>
+      <xs:enumeration value="bottom"/>
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="legend">
+    <xs:annotation>
+      <xs:documentation>
+      fieldset label
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="accesskey" type="Character"/>
+          <xs:attribute name="align" type="LAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="button">
+    <xs:annotation>
+      <xs:documentation>
+      Content is "Flow" excluding a, form and form controls
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="button.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="focus"/>
+          <xs:attribute name="name"/>
+          <xs:attribute name="value"/>
+          <xs:attribute name="type" default="submit">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="button"/>
+                <xs:enumeration value="submit"/>
+                <xs:enumeration value="reset"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="disabled">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="disabled"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="isindex">
+    <xs:annotation>
+      <xs:documentation>
+      single-line text input control (DEPRECATED)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="coreattrs"/>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="prompt" type="Text"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ======================= Tables =======================================
+
+    Derived from IETF HTML table standard, see [RFC1942]
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="TFrame">
+    <xs:annotation>
+      <xs:documentation>
+      The border attribute sets the thickness of the frame around the
+      table. The default units are screen pixels.
+
+      The frame attribute specifies which parts of the frame around
+      the table should be rendered. The values are not the same as
+      CALS to avoid a name clash with the valign attribute.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="void"/>
+      <xs:enumeration value="above"/>
+      <xs:enumeration value="below"/>
+      <xs:enumeration value="hsides"/>
+      <xs:enumeration value="lhs"/>
+      <xs:enumeration value="rhs"/>
+      <xs:enumeration value="vsides"/>
+      <xs:enumeration value="box"/>
+      <xs:enumeration value="border"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="TRules">
+    <xs:annotation>
+      <xs:documentation>
+      The rules attribute defines which rules to draw between cells:
+
+      If rules is absent then assume:
+          "none" if border is absent or border="0" otherwise "all"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="none"/>
+      <xs:enumeration value="groups"/>
+      <xs:enumeration value="rows"/>
+      <xs:enumeration value="cols"/>
+      <xs:enumeration value="all"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="TAlign">
+    <xs:annotation>
+      <xs:documentation>
+      horizontal placement of table relative to document
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="center"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:attributeGroup name="cellhalign">
+    <xs:annotation>
+      <xs:documentation>
+      horizontal alignment attributes for cell contents
+
+      char        alignment char, e.g. char=':'
+      charoff     offset for alignment char
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="align">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="left"/>
+          <xs:enumeration value="center"/>
+          <xs:enumeration value="right"/>
+          <xs:enumeration value="justify"/>
+          <xs:enumeration value="char"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="char" type="Character"/>
+    <xs:attribute name="charoff" type="Length"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="cellvalign">
+    <xs:annotation>
+      <xs:documentation>
+      vertical alignment attributes for cell contents
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="valign">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="top"/>
+          <xs:enumeration value="middle"/>
+          <xs:enumeration value="bottom"/>
+          <xs:enumeration value="baseline"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:element name="table">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="caption"/>
+        <xs:choice>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="col"/>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="colgroup"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="thead"/>
+        <xs:element minOccurs="0" ref="tfoot"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="tbody"/>
+          <xs:element maxOccurs="unbounded" ref="tr"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="summary" type="Text"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="border" type="Pixels"/>
+      <xs:attribute name="frame" type="TFrame"/>
+      <xs:attribute name="rules" type="TRules"/>
+      <xs:attribute name="cellspacing" type="Length"/>
+      <xs:attribute name="cellpadding" type="Length"/>
+      <xs:attribute name="align" type="TAlign"/>
+      <xs:attribute name="bgcolor" type="Color"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="CAlign">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="top"/>
+      <xs:enumeration value="bottom"/>
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="caption">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="align" type="CAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    Use thead to duplicate headers when breaking table
+    across page boundaries, or for static headers when
+    tbody sections are rendered in scrolling panel.
+
+    Use tfoot to duplicate footers when breaking table
+    across page boundaries, or for static footers when
+    tbody sections are rendered in scrolling panel.
+
+    Use multiple tbody sections when rules are needed
+    between groups of table rows.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="thead">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tfoot">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tbody">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="colgroup">
+    <xs:annotation>
+      <xs:documentation>
+      colgroup groups a set of col elements. It allows you to group
+      several semantically related columns together.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="col"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="span" default="1" type="Number"/>
+      <xs:attribute name="width" type="MultiLength"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="col">
+    <xs:annotation>
+      <xs:documentation>
+      col elements define the alignment properties for cells in
+      one or more columns.
+
+      The width attribute specifies the width of the columns, e.g.
+
+          width=64        width in screen pixels
+          width=0.5*      relative width of 0.5
+
+      The span attribute causes the attributes of one
+      col element to apply to more than one column.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="span" default="1" type="Number"/>
+      <xs:attribute name="width" type="MultiLength"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tr">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="th"/>
+        <xs:element ref="td"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+      <xs:attribute name="bgcolor" type="Color"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="Scope">
+    <xs:annotation>
+      <xs:documentation>
+      Scope is simpler than headers attribute for common tables
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="row"/>
+      <xs:enumeration value="col"/>
+      <xs:enumeration value="rowgroup"/>
+      <xs:enumeration value="colgroup"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    th is for headers, td for data and for cells acting as both
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="th">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="abbr" type="Text"/>
+          <xs:attribute name="axis"/>
+          <xs:attribute name="headers" type="xs:IDREFS"/>
+          <xs:attribute name="scope" type="Scope"/>
+          <xs:attribute name="rowspan" default="1" type="Number"/>
+          <xs:attribute name="colspan" default="1" type="Number"/>
+          <xs:attributeGroup ref="cellhalign"/>
+          <xs:attributeGroup ref="cellvalign"/>
+          <xs:attribute name="nowrap">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="nowrap"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="bgcolor" type="Color"/>
+          <xs:attribute name="width" type="Length"/>
+          <xs:attribute name="height" type="Length"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="td">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="abbr" type="Text"/>
+          <xs:attribute name="axis"/>
+          <xs:attribute name="headers" type="xs:IDREFS"/>
+          <xs:attribute name="scope" type="Scope"/>
+          <xs:attribute name="rowspan" default="1" type="Number"/>
+          <xs:attribute name="colspan" default="1" type="Number"/>
+          <xs:attributeGroup ref="cellhalign"/>
+          <xs:attributeGroup ref="cellvalign"/>
+          <xs:attribute name="nowrap">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="nowrap"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="bgcolor" type="Color"/>
+          <xs:attribute name="width" type="Length"/>
+          <xs:attribute name="height" type="Length"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+</xs:schema>
diff --git a/src/etc/xhtml2java.groovy b/src/etc/xhtml2java.groovy
new file mode 100644
index 0000000..a040997
--- /dev/null
+++ b/src/etc/xhtml2java.groovy
@@ -0,0 +1,136 @@
+/**
+ * Copyright (C) 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.Writer;
+
+public class Elem {
+	String name;
+	String type;
+	String doc = "";
+	public String toString() {
+		return "{name: $name, type: $type, doc:$doc}";
+	}
+}
+
+def xs = new groovy.xml.Namespace("http://www.w3.org/2001/XMLSchema", 'xs');
+def schemaFile = "xhtml1-transitional.xsd";
+def root = new XmlParser().parse(schemaFile);
+//print root;
+def elements = root[xs.element].findAll{ it.'@name' };
+
+def es = [];
+for (e in elements) {
+	def type;
+	if (e.'@name' in ['div', 'script', 'textarea', 'iframe'])
+		type = "pair";
+	else if (e[xs.complexType][xs.sequence])
+		type = "pair";
+	else if (e[xs.complexType][xs.choice])
+		type = "pair";
+	else if (e[xs.complexType].findAll { it.'@mixed' == 'true'})
+		type = "normal";
+	else
+		type = "self";
+	def et = new Elem();
+	et.name = e.'@name';
+	et.type = type;
+	if (e[xs.annotation][xs.documentation])
+		et.doc = e[xs.annotation][xs.documentation][0].text();
+	es << et;
+		
+}
+def attributes = root.breadthFirst().findAll { it.name() == "xs:attribute" }.collect { it.'@name' };
+attributes = new ArrayList(new HashSet(attributes));
+attributes.sort();
+es.sort { a,b -> a.name.compareTo b.name};
+//print elements;
+def javaReserved = ["abstract","continue","for","new","switch","assert",
+	"default","goto","package","synchronized","boolean","do","if","private",
+	"this","break","double","implements","protected","throw","byte","else","import","public","throws",
+	"case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final",
+	"interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while",
+	"null", "true", "false"]
+def reserved = ['ns', 'xmlns', 'start', 'end', 'attr', 'raw', 'text', 'bind', 'unbind', 'getSelf'] + javaReserved;
+
+def className = "GeneratedHtmlBuilder"
+print """
+package com.googlecode.jatl;
+
+import java.io.Writer;
+
+/**
+ * Auto-Generated builder from schema: $schemaFile
+ */
+protected abstract class $className<T> extends MarkupBuilder<T> {
+
+	public $className(Writer writer) {
+		super(writer);
+	}
+	
+	public $className(MarkupBuilder<?> builder) {
+		super(builder);
+	}
+
+	public $className(MarkupBuilder<?> builder, boolean nested) {
+		super(builder, nested);
+	}
+	
+	protected $className() {
+		super();
+	}
+"""
+
+for (e in es) {
+if ( ! e.name ) continue;
+def name = e.name;
+def t = e.name;
+if (name in reserved) name = name+"Tag";
+def type = e.type.toUpperCase();
+def header = "Starts the <" + t + "> tag."
+def lines = [header] + e.doc.split('\n') + ["<p>", "Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#$type}", 
+	"@return this, never <code>null</code>"];
+def doc = '/**\n\t * ' + lines.join('\n\t * ') + " \n\t */";
+
+print """
+	$doc
+	public T $name() {
+		return start("$t", TagClosingPolicy.$type);
+	}
+""";
+}
+
+for (a in attributes) {
+	def name = a in reserved ? a + "Attr" : a;
+print """
+	/**
+	 * Sets the <code>$a</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T $name(String value) {
+		return attr("$a", value);
+	}
+""";
+}
+
+print """
+}
+""";
+
+
+
diff --git a/src/main/java/com/googlecode/jatl/GeneratedHtmlBuilder.java b/src/main/java/com/googlecode/jatl/GeneratedHtmlBuilder.java
new file mode 100644
index 0000000..a2d0a25
--- /dev/null
+++ b/src/main/java/com/googlecode/jatl/GeneratedHtmlBuilder.java
@@ -0,0 +1,2309 @@
+/**
+ * Copyright (C) 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package com.googlecode.jatl;
+
+import java.io.Writer;
+
+/**
+ * Auto-Generated builder from schema: xhtml1-transitional.xsd
+ */
+abstract class GeneratedHtmlBuilder<T> extends MarkupBuilder<T> {
+
+	public GeneratedHtmlBuilder(Writer writer) {
+		super(writer);
+	}
+	
+	public GeneratedHtmlBuilder(MarkupBuilder<?> builder) {
+		super(builder);
+	}
+
+	public GeneratedHtmlBuilder(MarkupBuilder<?> builder, boolean nested) {
+		super(builder, nested);
+	}
+	
+	protected GeneratedHtmlBuilder() {
+		super();
+	}
+
+	/**
+	 * Starts the <a> tag.
+	 * [content is "Inline" except that anchors shouldn't be nested]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T a() {
+		return start("a", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <abbr> tag.
+	 * [abbreviation]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T abbr() {
+		return start("abbr", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <acronym> tag.
+	 * [acronym]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T acronym() {
+		return start("acronym", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <address> tag.
+	 * [information on author]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T address() {
+		return start("address", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <applet> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T applet() {
+		return start("applet", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <area> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#SELF}
+	 * @return this, never <code>null</code> 
+	 */
+	public T area() {
+		return start("area", TagClosingPolicy.SELF);
+	}
+
+	/**
+	 * Starts the <b> tag.
+	 * [bold font]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T b() {
+		return start("b", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <base> tag.
+	 * [document base URI]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#SELF}
+	 * @return this, never <code>null</code> 
+	 */
+	public T base() {
+		return start("base", TagClosingPolicy.SELF);
+	}
+
+	/**
+	 * Starts the <basefont> tag.
+	 * [base font size]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#SELF}
+	 * @return this, never <code>null</code> 
+	 */
+	public T basefont() {
+		return start("basefont", TagClosingPolicy.SELF);
+	}
+
+	/**
+	 * Starts the <bdo> tag.
+	 * [I18N BiDi over-ride]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T bdo() {
+		return start("bdo", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <big> tag.
+	 * [bigger font]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T big() {
+		return start("big", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <blockquote> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T blockquote() {
+		return start("blockquote", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <body> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T body() {
+		return start("body", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <br> tag.
+	 * [forced line break]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#SELF}
+	 * @return this, never <code>null</code> 
+	 */
+	public T br() {
+		return start("br", TagClosingPolicy.SELF);
+	}
+
+	/**
+	 * Starts the <button> tag.
+	 * [Content is "Flow" excluding a, form and form controls]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T button() {
+		return start("button", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <caption> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T caption() {
+		return start("caption", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <center> tag.
+	 * [center content]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T center() {
+		return start("center", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <cite> tag.
+	 * [citation]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T cite() {
+		return start("cite", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <code> tag.
+	 * [program code]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T code() {
+		return start("code", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <col> tag.
+	 * [col elements define the alignment properties for cells in,       one or more columns., ,       The width attribute specifies the width of the columns, e.g., ,           width=64        width in screen pixels,           width=0.5*      relative width of 0.5, ,       The span attribute causes the attributes of one,       col element to apply to more than one column.]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#SELF}
+	 * @return this, never <code>null</code> 
+	 */
+	public T col() {
+		return start("col", TagClosingPolicy.SELF);
+	}
+
+	/**
+	 * Starts the <colgroup> tag.
+	 * [colgroup groups a set of col elements. It allows you to group,       several semantically related columns together.]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T colgroup() {
+		return start("colgroup", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <dd> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T dd() {
+		return start("dd", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <del> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T del() {
+		return start("del", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <dfn> tag.
+	 * [definitional]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T dfn() {
+		return start("dfn", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <dir> tag.
+	 * [multiple column list (DEPRECATED)]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T dir() {
+		return start("dir", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <div> tag.
+	 * [generic language/style container]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T div() {
+		return start("div", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <dl> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T dl() {
+		return start("dl", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <dt> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T dt() {
+		return start("dt", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <em> tag.
+	 * [emphasis]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T em() {
+		return start("em", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <fieldset> tag.
+	 * [The fieldset element is used to group form fields.,       Only one legend element should occur in the content,       and if present should only be preceded by whitespace., ,       NOTE: this content model is different from the XHTML 1.0 DTD,,       closer to the intended content model in HTML4 DTD]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T fieldset() {
+		return start("fieldset", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <font> tag.
+	 * [local change to font]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T font() {
+		return start("font", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <form> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T form() {
+		return start("form", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <h1> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T h1() {
+		return start("h1", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <h2> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T h2() {
+		return start("h2", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <h3> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T h3() {
+		return start("h3", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <h4> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T h4() {
+		return start("h4", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <h5> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T h5() {
+		return start("h5", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <h6> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T h6() {
+		return start("h6", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <head> tag.
+	 * [content model is "head.misc" combined with a single,       title and an optional base element in any order]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T head() {
+		return start("head", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <hr> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#SELF}
+	 * @return this, never <code>null</code> 
+	 */
+	public T hr() {
+		return start("hr", TagClosingPolicy.SELF);
+	}
+
+	/**
+	 * Starts the <html> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T html() {
+		return start("html", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <i> tag.
+	 * [italic font]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T i() {
+		return start("i", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <iframe> tag.
+	 * [inline subwindow]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T iframe() {
+		return start("iframe", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <img> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#SELF}
+	 * @return this, never <code>null</code> 
+	 */
+	public T img() {
+		return start("img", TagClosingPolicy.SELF);
+	}
+
+	/**
+	 * Starts the <input> tag.
+	 * [form control]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#SELF}
+	 * @return this, never <code>null</code> 
+	 */
+	public T input() {
+		return start("input", TagClosingPolicy.SELF);
+	}
+
+	/**
+	 * Starts the <ins> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T ins() {
+		return start("ins", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <isindex> tag.
+	 * [single-line text input control (DEPRECATED)]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#SELF}
+	 * @return this, never <code>null</code> 
+	 */
+	public T isindex() {
+		return start("isindex", TagClosingPolicy.SELF);
+	}
+
+	/**
+	 * Starts the <kbd> tag.
+	 * [something user would type]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T kbd() {
+		return start("kbd", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <label> tag.
+	 * [Each label must not contain more than ONE field,       Label elements shouldn't be nested.]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T label() {
+		return start("label", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <legend> tag.
+	 * [fieldset label]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T legend() {
+		return start("legend", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <li> tag.
+	 * [list item]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T li() {
+		return start("li", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <link> tag.
+	 * [Relationship values can be used in principle:, ,       a) for document specific toolbars/menus when used,          with the link element in document head e.g.,            start, contents, previous, next, index, end, help,       b) to link to a separate style sheet (rel="stylesheet"),       c) to make a link to a script (rel="script"),       d) by stylesheets to control how collections of,          html nodes are rendered into printed documents,       e) to make a link to a printable [...]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#SELF}
+	 * @return this, never <code>null</code> 
+	 */
+	public T link() {
+		return start("link", TagClosingPolicy.SELF);
+	}
+
+	/**
+	 * Starts the <map> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T map() {
+		return start("map", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <menu> tag.
+	 * [single column list (DEPRECATED)]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T menu() {
+		return start("menu", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <meta> tag.
+	 * [generic metainformation]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#SELF}
+	 * @return this, never <code>null</code> 
+	 */
+	public T meta() {
+		return start("meta", TagClosingPolicy.SELF);
+	}
+
+	/**
+	 * Starts the <noframes> tag.
+	 * [alternate content container for non frame-based rendering]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T noframes() {
+		return start("noframes", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <noscript> tag.
+	 * [alternate content container for non script-based rendering]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T noscript() {
+		return start("noscript", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <object> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T object() {
+		return start("object", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <ol> tag.
+	 * [Ordered (numbered) list]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T ol() {
+		return start("ol", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <optgroup> tag.
+	 * [option group]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T optgroup() {
+		return start("optgroup", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <option> tag.
+	 * [selectable choice]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T option() {
+		return start("option", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <p> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T p() {
+		return start("p", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <param> tag.
+	 * [param is used to supply a named property value.,       In XML it would seem natural to follow RDF and support an,       abbreviated syntax where the param elements are replaced,       by attribute value pairs on the object start tag.]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#SELF}
+	 * @return this, never <code>null</code> 
+	 */
+	public T param() {
+		return start("param", TagClosingPolicy.SELF);
+	}
+
+	/**
+	 * Starts the <pre> tag.
+	 * [content is "Inline" excluding ,          "img|object|applet|big|small|sub|sup|font|basefont"]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T pre() {
+		return start("pre", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <q> tag.
+	 * [inlined quote]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T q() {
+		return start("q", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <s> tag.
+	 * [strike-through]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T s() {
+		return start("s", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <samp> tag.
+	 * [sample]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T samp() {
+		return start("samp", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <script> tag.
+	 * [script statements, which may include CDATA sections]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T script() {
+		return start("script", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <select> tag.
+	 * [option selector]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T select() {
+		return start("select", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <small> tag.
+	 * [smaller font]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T small() {
+		return start("small", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <span> tag.
+	 * [generic language/style container]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T span() {
+		return start("span", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <strike> tag.
+	 * [strike-through]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T strike() {
+		return start("strike", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <strong> tag.
+	 * [strong emphasis]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T strong() {
+		return start("strong", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <style> tag.
+	 * [style info, which may include CDATA sections]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T style() {
+		return start("style", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <sub> tag.
+	 * [subscript]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T sub() {
+		return start("sub", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <sup> tag.
+	 * [superscript]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T sup() {
+		return start("sup", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <table> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T table() {
+		return start("table", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <tbody> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T tbody() {
+		return start("tbody", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <td> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T td() {
+		return start("td", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <textarea> tag.
+	 * [multi-line text field]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T textarea() {
+		return start("textarea", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <tfoot> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T tfoot() {
+		return start("tfoot", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <th> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T th() {
+		return start("th", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <thead> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T thead() {
+		return start("thead", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <title> tag.
+	 * [The title element is not considered part of the flow of text.,       It should be displayed, for example as the page header or,       window title. Exactly one title is required per document.]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T title() {
+		return start("title", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <tr> tag.
+	 * []
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T tr() {
+		return start("tr", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <tt> tag.
+	 * [fixed pitch font]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T tt() {
+		return start("tt", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <u> tag.
+	 * [underline]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T u() {
+		return start("u", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Starts the <ul> tag.
+	 * [Unordered list]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#PAIR}
+	 * @return this, never <code>null</code> 
+	 */
+	public T ul() {
+		return start("ul", TagClosingPolicy.PAIR);
+	}
+
+	/**
+	 * Starts the <var> tag.
+	 * [variable]
+	 * <p>
+	 * Tag Closing Policy: {@link MarkupBuilder.TagClosingPolicy#NORMAL}
+	 * @return this, never <code>null</code> 
+	 */
+	public T var() {
+		return start("var", TagClosingPolicy.NORMAL);
+	}
+
+	/**
+	 * Sets the <code>abbr</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T abbr(String value) {
+		return attr("abbr", value);
+	}
+
+	/**
+	 * Sets the <code>accept</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T accept(String value) {
+		return attr("accept", value);
+	}
+
+	/**
+	 * Sets the <code>accept-charset</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T acceptCharset(String value) {
+		return attr("accept-charset", value);
+	}
+
+	/**
+	 * Sets the <code>accesskey</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T accesskey(String value) {
+		return attr("accesskey", value);
+	}
+
+	/**
+	 * Sets the <code>action</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T action(String value) {
+		return attr("action", value);
+	}
+
+	/**
+	 * Sets the <code>align</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T align(String value) {
+		return attr("align", value);
+	}
+
+	/**
+	 * Sets the <code>alink</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T alink(String value) {
+		return attr("alink", value);
+	}
+
+	/**
+	 * Sets the <code>alt</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T alt(String value) {
+		return attr("alt", value);
+	}
+
+	/**
+	 * Sets the <code>archive</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T archive(String value) {
+		return attr("archive", value);
+	}
+
+	/**
+	 * Sets the <code>axis</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T axis(String value) {
+		return attr("axis", value);
+	}
+
+	/**
+	 * Sets the <code>background</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T background(String value) {
+		return attr("background", value);
+	}
+
+	/**
+	 * Sets the <code>bgcolor</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T bgcolor(String value) {
+		return attr("bgcolor", value);
+	}
+
+	/**
+	 * Sets the <code>border</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T border(String value) {
+		return attr("border", value);
+	}
+
+	/**
+	 * Sets the <code>cellpadding</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T cellpadding(String value) {
+		return attr("cellpadding", value);
+	}
+
+	/**
+	 * Sets the <code>cellspacing</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T cellspacing(String value) {
+		return attr("cellspacing", value);
+	}
+
+	/**
+	 * Sets the <code>char</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T charAttr(String value) {
+		return attr("char", value);
+	}
+
+	/**
+	 * Sets the <code>charoff</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T charoff(String value) {
+		return attr("charoff", value);
+	}
+
+	/**
+	 * Sets the <code>charset</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T charset(String value) {
+		return attr("charset", value);
+	}
+
+	/**
+	 * Sets the <code>checked</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T checked(String value) {
+		return attr("checked", value);
+	}
+
+	/**
+	 * Sets the <code>cite</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T cite(String value) {
+		return attr("cite", value);
+	}
+
+	/**
+	 * Sets the <code>class</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T classAttr(String value) {
+		return attr("class", value);
+	}
+
+	/**
+	 * Sets the <code>classid</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T classid(String value) {
+		return attr("classid", value);
+	}
+
+	/**
+	 * Sets the <code>clear</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T clear(String value) {
+		return attr("clear", value);
+	}
+
+	/**
+	 * Sets the <code>code</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T code(String value) {
+		return attr("code", value);
+	}
+
+	/**
+	 * Sets the <code>codebase</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T codebase(String value) {
+		return attr("codebase", value);
+	}
+
+	/**
+	 * Sets the <code>codetype</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T codetype(String value) {
+		return attr("codetype", value);
+	}
+
+	/**
+	 * Sets the <code>color</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T color(String value) {
+		return attr("color", value);
+	}
+
+	/**
+	 * Sets the <code>cols</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T cols(String value) {
+		return attr("cols", value);
+	}
+
+	/**
+	 * Sets the <code>colspan</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T colspan(String value) {
+		return attr("colspan", value);
+	}
+
+	/**
+	 * Sets the <code>compact</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T compact(String value) {
+		return attr("compact", value);
+	}
+
+	/**
+	 * Sets the <code>content</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T content(String value) {
+		return attr("content", value);
+	}
+
+	/**
+	 * Sets the <code>coords</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T coords(String value) {
+		return attr("coords", value);
+	}
+
+	/**
+	 * Sets the <code>data</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T data(String value) {
+		return attr("data", value);
+	}
+
+	/**
+	 * Sets the <code>datetime</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T datetime(String value) {
+		return attr("datetime", value);
+	}
+
+	/**
+	 * Sets the <code>declare</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T declare(String value) {
+		return attr("declare", value);
+	}
+
+	/**
+	 * Sets the <code>defer</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T defer(String value) {
+		return attr("defer", value);
+	}
+
+	/**
+	 * Sets the <code>dir</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T dir(String value) {
+		return attr("dir", value);
+	}
+
+	/**
+	 * Sets the <code>disabled</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T disabled(String value) {
+		return attr("disabled", value);
+	}
+
+	/**
+	 * Sets the <code>enctype</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T enctype(String value) {
+		return attr("enctype", value);
+	}
+
+	/**
+	 * Sets the <code>face</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T face(String value) {
+		return attr("face", value);
+	}
+
+	/**
+	 * Sets the <code>for</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T forAttr(String value) {
+		return attr("for", value);
+	}
+
+	/**
+	 * Sets the <code>frame</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T frame(String value) {
+		return attr("frame", value);
+	}
+
+	/**
+	 * Sets the <code>frameborder</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T frameborder(String value) {
+		return attr("frameborder", value);
+	}
+
+	/**
+	 * Sets the <code>headers</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T headers(String value) {
+		return attr("headers", value);
+	}
+
+	/**
+	 * Sets the <code>height</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T height(String value) {
+		return attr("height", value);
+	}
+
+	/**
+	 * Sets the <code>href</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T href(String value) {
+		return attr("href", value);
+	}
+
+	/**
+	 * Sets the <code>hreflang</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T hreflang(String value) {
+		return attr("hreflang", value);
+	}
+
+	/**
+	 * Sets the <code>hspace</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T hspace(String value) {
+		return attr("hspace", value);
+	}
+
+	/**
+	 * Sets the <code>http-equiv</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T httpEquiv(String value) {
+		return attr("http-equiv", value);
+	}
+
+	/**
+	 * Sets the <code>id</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T id(String value) {
+		return attr("id", value);
+	}
+
+	/**
+	 * Sets the <code>ismap</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T ismap(String value) {
+		return attr("ismap", value);
+	}
+
+	/**
+	 * Sets the <code>label</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T label(String value) {
+		return attr("label", value);
+	}
+
+	/**
+	 * Sets the <code>lang</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T lang(String value) {
+		return attr("lang", value);
+	}
+
+	/**
+	 * Sets the <code>language</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T language(String value) {
+		return attr("language", value);
+	}
+
+	/**
+	 * Sets the <code>link</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T link(String value) {
+		return attr("link", value);
+	}
+
+	/**
+	 * Sets the <code>longdesc</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T longdesc(String value) {
+		return attr("longdesc", value);
+	}
+
+	/**
+	 * Sets the <code>marginheight</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T marginheight(String value) {
+		return attr("marginheight", value);
+	}
+
+	/**
+	 * Sets the <code>marginwidth</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T marginwidth(String value) {
+		return attr("marginwidth", value);
+	}
+
+	/**
+	 * Sets the <code>maxlength</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T maxlength(String value) {
+		return attr("maxlength", value);
+	}
+
+	/**
+	 * Sets the <code>media</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T media(String value) {
+		return attr("media", value);
+	}
+
+	/**
+	 * Sets the <code>method</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T method(String value) {
+		return attr("method", value);
+	}
+
+	/**
+	 * Sets the <code>multiple</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T multiple(String value) {
+		return attr("multiple", value);
+	}
+
+	/**
+	 * Sets the <code>name</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T name(String value) {
+		return attr("name", value);
+	}
+
+	/**
+	 * Sets the <code>nohref</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T nohref(String value) {
+		return attr("nohref", value);
+	}
+
+	/**
+	 * Sets the <code>noshade</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T noshade(String value) {
+		return attr("noshade", value);
+	}
+
+	/**
+	 * Sets the <code>nowrap</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T nowrap(String value) {
+		return attr("nowrap", value);
+	}
+
+	/**
+	 * Sets the <code>object</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T object(String value) {
+		return attr("object", value);
+	}
+
+	/**
+	 * Sets the <code>onblur</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onblur(String value) {
+		return attr("onblur", value);
+	}
+
+	/**
+	 * Sets the <code>onchange</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onchange(String value) {
+		return attr("onchange", value);
+	}
+
+	/**
+	 * Sets the <code>onclick</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onclick(String value) {
+		return attr("onclick", value);
+	}
+
+	/**
+	 * Sets the <code>ondblclick</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T ondblclick(String value) {
+		return attr("ondblclick", value);
+	}
+
+	/**
+	 * Sets the <code>onfocus</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onfocus(String value) {
+		return attr("onfocus", value);
+	}
+
+	/**
+	 * Sets the <code>onkeydown</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onkeydown(String value) {
+		return attr("onkeydown", value);
+	}
+
+	/**
+	 * Sets the <code>onkeypress</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onkeypress(String value) {
+		return attr("onkeypress", value);
+	}
+
+	/**
+	 * Sets the <code>onkeyup</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onkeyup(String value) {
+		return attr("onkeyup", value);
+	}
+
+	/**
+	 * Sets the <code>onload</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onload(String value) {
+		return attr("onload", value);
+	}
+
+	/**
+	 * Sets the <code>onmousedown</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onmousedown(String value) {
+		return attr("onmousedown", value);
+	}
+
+	/**
+	 * Sets the <code>onmousemove</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onmousemove(String value) {
+		return attr("onmousemove", value);
+	}
+
+	/**
+	 * Sets the <code>onmouseout</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onmouseout(String value) {
+		return attr("onmouseout", value);
+	}
+
+	/**
+	 * Sets the <code>onmouseover</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onmouseover(String value) {
+		return attr("onmouseover", value);
+	}
+
+	/**
+	 * Sets the <code>onmouseup</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onmouseup(String value) {
+		return attr("onmouseup", value);
+	}
+
+	/**
+	 * Sets the <code>onreset</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onreset(String value) {
+		return attr("onreset", value);
+	}
+
+	/**
+	 * Sets the <code>onselect</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onselect(String value) {
+		return attr("onselect", value);
+	}
+
+	/**
+	 * Sets the <code>onsubmit</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onsubmit(String value) {
+		return attr("onsubmit", value);
+	}
+
+	/**
+	 * Sets the <code>onunload</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T onunload(String value) {
+		return attr("onunload", value);
+	}
+
+	/**
+	 * Sets the <code>profile</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T profile(String value) {
+		return attr("profile", value);
+	}
+
+	/**
+	 * Sets the <code>prompt</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T prompt(String value) {
+		return attr("prompt", value);
+	}
+
+	/**
+	 * Sets the <code>readonly</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T readonly(String value) {
+		return attr("readonly", value);
+	}
+
+	/**
+	 * Sets the <code>rel</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T rel(String value) {
+		return attr("rel", value);
+	}
+
+	/**
+	 * Sets the <code>rev</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T rev(String value) {
+		return attr("rev", value);
+	}
+
+	/**
+	 * Sets the <code>rows</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T rows(String value) {
+		return attr("rows", value);
+	}
+
+	/**
+	 * Sets the <code>rowspan</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T rowspan(String value) {
+		return attr("rowspan", value);
+	}
+
+	/**
+	 * Sets the <code>rules</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T rules(String value) {
+		return attr("rules", value);
+	}
+
+	/**
+	 * Sets the <code>scheme</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T scheme(String value) {
+		return attr("scheme", value);
+	}
+
+	/**
+	 * Sets the <code>scope</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T scope(String value) {
+		return attr("scope", value);
+	}
+
+	/**
+	 * Sets the <code>scrolling</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T scrolling(String value) {
+		return attr("scrolling", value);
+	}
+
+	/**
+	 * Sets the <code>selected</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T selected(String value) {
+		return attr("selected", value);
+	}
+
+	/**
+	 * Sets the <code>shape</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T shape(String value) {
+		return attr("shape", value);
+	}
+
+	/**
+	 * Sets the <code>size</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T size(String value) {
+		return attr("size", value);
+	}
+
+	/**
+	 * Sets the <code>span</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T span(String value) {
+		return attr("span", value);
+	}
+
+	/**
+	 * Sets the <code>src</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T src(String value) {
+		return attr("src", value);
+	}
+
+	/**
+	 * Sets the <code>standby</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T standby(String value) {
+		return attr("standby", value);
+	}
+
+	/**
+	 * Sets the <code>start</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T startAttr(String value) {
+		return attr("start", value);
+	}
+
+	/**
+	 * Sets the <code>style</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T style(String value) {
+		return attr("style", value);
+	}
+
+	/**
+	 * Sets the <code>summary</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T summary(String value) {
+		return attr("summary", value);
+	}
+
+	/**
+	 * Sets the <code>tabindex</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T tabindex(String value) {
+		return attr("tabindex", value);
+	}
+
+	/**
+	 * Sets the <code>target</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T target(String value) {
+		return attr("target", value);
+	}
+
+	/**
+	 * Sets the <code>text</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T textAttr(String value) {
+		return attr("text", value);
+	}
+
+	/**
+	 * Sets the <code>title</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T title(String value) {
+		return attr("title", value);
+	}
+
+	/**
+	 * Sets the <code>type</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T type(String value) {
+		return attr("type", value);
+	}
+
+	/**
+	 * Sets the <code>usemap</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T usemap(String value) {
+		return attr("usemap", value);
+	}
+
+	/**
+	 * Sets the <code>valign</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T valign(String value) {
+		return attr("valign", value);
+	}
+
+	/**
+	 * Sets the <code>value</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T value(String value) {
+		return attr("value", value);
+	}
+
+	/**
+	 * Sets the <code>valuetype</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T valuetype(String value) {
+		return attr("valuetype", value);
+	}
+
+	/**
+	 * Sets the <code>vlink</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T vlink(String value) {
+		return attr("vlink", value);
+	}
+
+	/**
+	 * Sets the <code>vspace</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T vspace(String value) {
+		return attr("vspace", value);
+	}
+
+	/**
+	 * Sets the <code>width</code> attribute on the last started tag that 
+	 * has not been closed.
+	 *
+	 * @param value the value to set, maybe <code>null</code>
+	 * @return this, never <code>null</code>
+	 */
+	public T width(String value) {
+		return attr("width", value);
+	}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/googlecode/jatl/Html.java b/src/main/java/com/googlecode/jatl/Html.java
new file mode 100644
index 0000000..53d7d61
--- /dev/null
+++ b/src/main/java/com/googlecode/jatl/Html.java
@@ -0,0 +1,80 @@
+/**
+ * Copyright (C) 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.googlecode.jatl;
+
+import java.io.Writer;
+
+/**
+ * Most of the XHTML tags and attributes are available as methods.
+ * A rule of thumb is that most tags are zero parameter methods and attribute
+ * methods are single parameter.
+ * <p>
+ * <strong>Example:</strong>
+ * <pre>
+ * new Html(writer) {{
+ * 	html().head();
+ * 	title().text("Hello").end();
+ *	h1().id("title").text("World").end();
+ * 	done();
+ * }};
+ * </pre>
+ * <p>
+ * If you would like to extend an HTML builder <em>DO NOT INHERIT FROM THIS CLASS</em>.
+ * <p>
+ *  Instead inherit from {@link HtmlBuilder} and parameterize with the name of your custom builder.
+ *  <p>
+ * @author adamgent
+ */
+public class Html extends HtmlBuilder<Html> {
+
+
+	/**
+	 * See {@link MarkupBuilder#MarkupBuilder(Writer)}
+	 * @param writer never <code>null</code>.
+	 */
+	public Html(Writer writer) {
+		super(writer);
+	}
+	
+	/**
+	 * See {@link MarkupBuilder#MarkupBuilder(MarkupBuilder)}
+	 * @param builder never <code>null</code>.
+	 */
+	public Html(MarkupBuilder<?> builder) {
+		super(builder);
+	}
+	
+	
+
+	/**
+	 * See {@link MarkupBuilder#MarkupBuilder(MarkupBuilder, boolean)}
+	 * @param builder never <code>null</code>.
+	 * @param nested never <code>null</code>.
+	 */
+	public Html(MarkupBuilder<?> builder, boolean nested) {
+		super(builder, nested);
+	}
+
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
+	protected Html getSelf() {
+		return this;
+	}	
+	
+}
\ No newline at end of file
diff --git a/src/main/java/com/googlecode/jatl/HtmlBuilder.java b/src/main/java/com/googlecode/jatl/HtmlBuilder.java
new file mode 100644
index 0000000..4543162
--- /dev/null
+++ b/src/main/java/com/googlecode/jatl/HtmlBuilder.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright (C) 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.googlecode.jatl;
+
+import java.io.Writer;
+
+import org.apache.commons.lang.StringEscapeUtils;
+
+/**
+ * Most of the XHTML tags and attributes are available as methods.
+ * A rule of thumb is that most tags are zero parameter methods and attribute
+ * methods are single parameter.
+ * 
+ * @author adamgent
+ *
+ * @param <T> See {@link MarkupBuilder} for how this should be parameterized.
+ */
+public abstract class HtmlBuilder<T> extends GeneratedHtmlBuilder<T> {
+
+	public HtmlBuilder(Writer writer) {
+		super(writer);
+	}
+	
+	public HtmlBuilder(MarkupBuilder<?> builder) {
+		super(builder);
+	}
+
+	public HtmlBuilder(MarkupBuilder<?> builder, boolean nested) {
+		super(builder, nested);
+	}
+	
+	protected HtmlBuilder() {
+		super();
+	}
+
+	
+	public T checkbox() {
+		return checkbox(false);
+	}
+	
+	public T checkbox(boolean checked) {
+		input();
+		attr("type", "checkbox");
+		if (checked)
+			attr("checked", "checked");
+		return getSelf();
+	}
+	
+	
+	public T option(String name, String value, boolean selected) {
+		option();
+		value(value);
+		if (selected)
+			selected("selected");
+		text(name);
+		end();
+		return getSelf();
+	}
+
+	@Override
+	protected String escapeMarkup(String raw) {
+		return StringEscapeUtils.escapeHtml(raw);
+	}
+
+}
diff --git a/src/main/java/com/googlecode/jatl/HtmlWriter.java b/src/main/java/com/googlecode/jatl/HtmlWriter.java
new file mode 100644
index 0000000..4ff98a1
--- /dev/null
+++ b/src/main/java/com/googlecode/jatl/HtmlWriter.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright (C) 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.googlecode.jatl;
+
+import java.io.Writer;
+
+/**
+ * Writes HTML using an {@link HtmlBuilder}
+ * by calling {@link #write(Writer)}.
+ * <p>
+ * <strong>Example:</strong><p>
+ * <pre>
+	html = new HtmlWriter() {
+		protected void build() {
+			html().head().end().body();
+			text("Hello");
+			done();
+		}
+	};
+	//Now write.
+	String actual = html.write(writer).getBuffer().toString();
+ * </pre>
+ * @author agent
+ * @see MarkupWriter
+ *
+ */
+public abstract class HtmlWriter extends HtmlBuilder<HtmlWriter> implements MarkupBuilderWriter {
+
+	public HtmlWriter() {
+		super();
+	}
+
+	@Override
+	protected HtmlWriter getSelf() {
+		return this;
+	}
+	
+	public <W extends Writer> W write(W writer) {
+		setWriter(writer);
+		build();
+		done();
+		return writer;
+	}
+	
+	public <W extends Writer> W write(W writer, int depth) {
+		setWriter(writer);
+		setDepth(depth);
+		build();
+		done();
+		return writer;
+	}	
+	
+	/**
+	 * Should build the markup and is called by {@link #write(Writer)}.
+	 * @see MarkupBuilder
+	 */
+	protected abstract void build();
+	
+}
diff --git a/src/main/java/com/googlecode/jatl/Indenter.java b/src/main/java/com/googlecode/jatl/Indenter.java
new file mode 100644
index 0000000..b5d15a6
--- /dev/null
+++ b/src/main/java/com/googlecode/jatl/Indenter.java
@@ -0,0 +1,81 @@
+/**
+ * Copyright (C) 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.googlecode.jatl;
+
+import java.io.IOException;
+
+import com.googlecode.jatl.MarkupBuilder.TagClosingPolicy;
+
+/**
+ * A strategy to indent or in other words pretty print
+ * the markup.
+ * <p>
+ * <b>EXPERIMENTAL MAY CHANGE</b>
+ * @author agent
+ * @see MarkupBuilder#indent(Indenter)
+ * @since 0.2.0
+ */
+public interface Indenter {
+	
+	/**
+	 * Called by the builder to provide whitespace decoration.
+	 * The arguments provides context of what tag, kind of tag and closing policy etc.
+	 * <p>
+	 * <b>EXPERIMENTAL MAY CHANGE</b>
+	 * @param a writer like object where indenting decoration is to be applied.
+	 * @param innerDepth current indent depth inside the current builder.
+	 * @param outerDepth starting depth based on the outside builder if there is one. Usually this is zero.
+	 * @param spot current position that white space is to be applied.
+	 * @param tag the tag to be indented, not <code>null</code>.
+	 * @param p closing policy for the tag to be indented.
+	 * @param empty if the tag is empty.
+	 * @see MarkupBuilder#indent(Indenter)
+	 * @throws IOException
+	 */
+	public void indentTag(
+			Appendable a,
+			int innerDepth, 
+			int outerDepth, 
+			TagIndentSpot spot, 
+			String tag, TagClosingPolicy p, boolean empty) throws IOException;
+	
+	/**
+	 * Indicates the current position (cursor) of where whitespace is to be applied.
+	 * <p>
+	 * <b>EXPERIMENTAL MAY CHANGE</b>
+	 * @author agent
+	 *
+	 */
+	public static enum TagIndentSpot {
+		/**
+		 * Indicates position is before <tag>
+		 */
+		BEFORE_START_TAG,
+		/**
+		 * Indicates position is after <tag>
+		 */
+		AFTER_START_TAG,
+		/**
+		 * Indicates position is before </tag>
+		 */
+		BEFORE_END_TAG,
+		/**
+		 * Indicates position is after </tag>
+		 */
+		AFTER_END_TAG
+	}
+}
diff --git a/src/main/java/com/googlecode/jatl/MarkupBuilder.java b/src/main/java/com/googlecode/jatl/MarkupBuilder.java
new file mode 100644
index 0000000..bc8f171
--- /dev/null
+++ b/src/main/java/com/googlecode/jatl/MarkupBuilder.java
@@ -0,0 +1,828 @@
+/**
+ * Copyright (C) 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.googlecode.jatl;
+
+import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang.Validate.isTrue;
+import static org.apache.commons.lang.Validate.notEmpty;
+import static org.apache.commons.lang.Validate.notNull;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Stack;
+
+import org.apache.commons.lang.text.StrSubstitutor;
+
+import com.googlecode.jatl.Indenter.TagIndentSpot;
+
+/**
+ * <a href="http://en.wikipedia.org/wiki/Fluent_interface">Fluent styled</a> 
+ * markup builder that writes to a {@link Writer}.
+ * 
+ * <h2>Description</h2>
+ * Writes XML markup to a {@link Writer}.
+ * The Builder part of the name is somewhat misleading as
+ * this class does not store or keep track of all the markup objects created but rather
+ * writes using the writer as soon as it can.
+ * Thus the order of operations performed on this class is very important and should 
+ * follow the order that you would write the markup.
+ * 
+ * <h2>Usage</h2>
+ * You should not use this class directly but rather one of its subclasses
+ * that is parameterized with itself (see Extending). You generally define the markup you want to write
+ * using Java anonymous classes that extend either a {@link MarkupBuilder} or {@link MarkupWriter}. 
+ * Markup builders write immediately to a writer where as a markup writer 
+ * writes when told to. But again in both cases you generally define the markup with an anonymous class.
+ * <p>
+ * For examples of use its best to see {@link Html} for an XHTML builder which will write XHTML 
+ * markup immediatly or {@link HtmlWriter} which allows you to define XHTML markup then write it later.
+ * <p>
+ * {@link MarkupWriter Markup writers} are more useful for MVC frameworks and {@link MarkupBuilder builders}
+ * are more for convenience.
+ * 
+ * <h2>Extending</h2>
+ * If you would you would like to make your own builder you should subclass 
+ * this class or a subclass that has generic parameter (<T>).
+ * <p>
+ * <em>The custom builder should be parameterized to itself to support fluent style.</em>
+ * <p>
+ * <strong>Example:</strong>
+ * <pre>
+public class MyMarkup extends MarkupBuilder<MyMarkup> {
+
+	public MyMarkup(Writer builder) {
+		super(builder);
+	}
+	protected MyMarkup getSelf() {
+		return this;
+	}
+	
+	public MyMarkup myTag() {
+		return start("myTag");
+	}
+}
+ * </pre>
+ * <h2>Composition</h2>
+ * Besides the extending method above you can achieve composition of markup builders by using MarkupWriter's instead.
+ * See {@link MarkupWriter}. <p>
+ * See {@link #write(MarkupWriter...)}.
+ * 
+ * <h2>Writing tags and attributes</h2>
+ * See {@link #start(String)} and {@link #end()} for writing tags.
+ * See {@link #attr(String...)} for writting attributes.
+ * 
+ * <h2>Variable expansion</h2>
+ * Simple named variable replacements are supported through the <pre>${...}</pre> notation.
+ * See {@link #bind(String, Object)}, and {@link #text(String)}.
+ * 
+ * <h2>Pretty Printing aka Indenting</h2>
+ * See #indent  {@link Indenter}. For most cases you can use {@link SimpleIndenter}
+ * 
+ * <h2>Namespaces</h2>
+ * You can either manually maintain namespaces and namespace prefixes by setting the correct attributes and 
+ * then writing tags with the namespace prefix. Example: {@code start("prefix:tagName")}.
+ * Or you can use the namespace methods: {@link #ns()}, {@link #ns(String)}, {@link #xmlns(String, String)}
+ * The following Nested builders are very helpful for working with multiple XML schemas.
+ * 
+ * <h2>Nested builders</h2>
+ * Nested builders are an easy way to allow different markup styles to coexist elegantly.
+ * An example might be HTML with in XSL. You would have an HTML builder nested inside
+ * the XSL builder.<p>
+ * <strong>Example:</strong>
+ * <pre>
+ * new Xslt(writer) {{
+ * 	ns("xsl");
+ * 	template().match("stuff");
+ * 		new Html(writer) {{
+ * 			html().body().done();
+ * 		}}
+ * 	done();
+ * }}
+ * </pre>
+ * See {@link #MarkupBuilder(MarkupBuilder)}.
+ * 
+ * <h2>Thread safety</h2>
+ * <em>This class and subclasses are not thread safe.</em>
+ * One way to make a builder thread safe is to synchronize on the passed in writer:
+ * <pre>
+ * synchronize(writer) {
+ *    new SomeBuilder(writer) {{ }}; 
+ * }
+ * </pre>
+ * <h2>Efficiency and Validation</h2>
+ * To keep the builder efficient and elegant there is very little XML validation.
+ * There is no guarantee that the markup generated will always be well formed.
+ * Generally {@link #text(String) Text} will be escaped appropriately.
+ * <p>
+ * <em>For those seriously concerned with performance an appropriate implementation of 
+ * {@link Writer} should be given to the builder.</em>
+ * <p>
+ * For example: In a single threaded environment where you are writing to memory 
+ * <a href="http://commons.apache.org/io/apidocs/org/apache/commons/io/output/StringBuilderWriter.html">
+ * Commons IO StringBuilderWriter
+ * </a> is a good choice over {@link StringWriter}.
+ * <p>
+ * On the other hand if you are writing very large XML document to a file 
+ * or network socket {@link PrintWriter} is probably a better choice.
+ * 
+ * @author adamgent
+ * @param <T> This should always be parameterized with the exact same 
+ * class that is extending the {@link MarkupBuilder} to support fluent style.
+ * @see TagClosingPolicy
+ * @see #start(String, TagClosingPolicy)
+ * @see #attr(String...)
+ * @see #end()
+ * @see #done()
+ */
+public abstract class MarkupBuilder<T> {
+	private Stack<Tag> tagStack = new Stack<Tag>();
+	private Writer writer;
+	private Map<String, String> attributes = createMap();
+	private Map<String, Object> bindings = new HashMap<String, Object>();
+	private MarkupBuilder<?> previousBuilder = null;
+	private int depth = 0;
+	private String namespacePrefix = null;
+	private Indenter previousIndenter = indentOn;
+	private Indenter indenter = indentOn;
+
+	private static final String q = "\"";
+	
+	/**
+	 * Create a builder using the given writer.
+	 * @param writer never <code>null</code>.
+	 */
+	public MarkupBuilder(Writer writer) {
+		super();
+		notNull(writer, "writer");
+		this.writer = writer;
+	}
+	
+	/**
+	 * Create a nested builder from given builder.
+	 * Make sure {@link #done()} is called when finished with the
+	 * nested builder so that the parent builder can resume using the writer.
+	 * 
+	 * @param builder parent builder, never <code>null</code>. 
+	 * @see #done()
+	 */
+	public MarkupBuilder(MarkupBuilder<?> builder) {
+		this(builder, true);
+	}
+	
+	/**
+	 * Use for deferred writer.
+	 * The writer should be {@link #setWriter(Writer) set} before 
+	 * the builder is used.
+	 * 
+	 * @see #setWriter(Writer)
+	 * @see MarkupWriter
+	 */
+	protected MarkupBuilder() {
+		
+	}
+	
+	/**
+	 * Create a nested builder from a builder or resume from a builder.
+	 * @param builder never <code>null</code>.
+	 * @param nested <code>true</code> means nested, <code>false</code> means resuming.
+	 */
+	public MarkupBuilder(MarkupBuilder<?> builder, boolean nested) {
+		builder.checkWriter();
+		if (nested)
+			builder.writeCurrentTag();
+		if (nested && ! builder.tagStack.isEmpty()) {
+			Tag t = builder.tagStack.peek();
+			this.depth = 1 + t.depth + builder.depth;
+		}
+		else {
+			this.depth = builder.depth;
+		}
+		this.writer = builder.writer;
+		builder.writer = null;
+		
+		if (nested) {
+			//Clone the previous builders binding
+			this.previousBuilder = builder;
+			this.bindings = new HashMap<String, Object>(builder.bindings);
+		}
+		else {
+			this.tagStack = builder.tagStack;
+			this.bindings = builder.bindings;
+			this.attributes = builder.attributes;
+		}
+	}
+	
+	/**
+	 * Needed for fluent style and Java parameterization limitations. 
+	 * Almost all public methods should return whatever this method returns.
+	 * <p>
+	 * Most implementations only have to do:
+	 * <pre>
+	 * return this;
+	 * </pre>
+	 * @return the current builder which is usually <code>this</code> object.
+	 */
+	protected abstract T getSelf();
+	
+	
+	/**
+	 * Restores the current namespace prefix
+	 * to whatever the surrounding tags prefix is.
+	 * To set the namespace to the default namespace call:
+	 * <p>
+	 * {@code ns(null);}
+	 * @return maybe <code>null</code>.
+	 * @see #ns(String)
+	 */
+	public final T ns() {
+		if (tagStack.isEmpty()) {
+			return ns(null);
+		}
+		return ns(tagStack.peek().prefix);
+	}
+
+	/**
+	 * Sets the current namespace prefix. If a tag is started when
+	 * the prefix is set to a non-null non-empty string, the prefix will
+	 * be added in front of the tag.
+	 * <p>
+	 * <strong>Example:</strong><p>
+	 * <pre>
+	 * ns("html").div().end();
+	 * </pre>
+	 * <strong>Result:</strong>
+	 * <p>
+	 * <pre>
+	 * <html:div></html:div>
+	 * </pre>
+	 * @param prefix maybe <code>null</code>
+	 * @return this, not <code>null</code>.
+	 */
+	public final T ns(String prefix) {
+		this.namespacePrefix = prefix;
+		return getSelf();
+	}
+
+	/**
+	 * Sets the writer after the builder has been created.
+	 * Only useful with the empty constructor.
+	 * @param writer never <code>null</code>
+	 * @throws IllegalArgumentException if the writer has already been set or the given writer is null.
+	 */
+	public final void setWriter(Writer writer) {
+		isTrue(this.writer == null, "Writer is already set.");
+		notNull(writer, "writer");
+		this.writer = writer;
+	}
+	
+	/**
+	 * Sets the indent depth after the builder has been created.
+	 * Only useful with the empty constructor.
+	 * @param depth should greater than or equal <code>0</code>
+	 */	
+	public final void setDepth(int depth) {
+		this.depth = depth;
+	}
+	
+	/**
+	 * Sets the indenter.
+	 * @param indenter if <code>null</code> reverts to the previous builder.
+	 * @return the builder.
+	 * @see #indentOn
+	 * @see #indentOff
+	 * @see #indentSameLine
+	 */
+	public T indent(Indenter indenter) {
+		if (indenter == null) 
+			this.indenter = previousIndenter;
+		else {
+			this.previousIndenter = this.indenter;
+			this.indenter = indenter;
+		}
+		return getSelf();
+	}
+	
+	private final Map<String, String> getAttributes() {
+		return attributes;
+	}
+
+	/**
+	 * Writes variable expanded escaped text inside a tag.
+	 * 
+	 * @param text the text will be escaped and variables will be expanded.
+	 * @return never <code>null</code>.
+	 * @see #raw(String)
+	 * @see #bind(String, Object)
+	 */
+	public final T text(String text) {
+		if (text != null) {
+			writeCurrentTag();
+			write(escapeElementMarkup(expand(text)));
+		}
+		return getSelf();
+	}
+	
+	/**
+	 * Write text with out escaping or variable expansion.
+	 * @param text
+	 * @return never <code>null</code>.
+	 * @see #raw(String, boolean)
+	 */
+	public final T raw(String text) {
+	    return raw(text, false);
+	}
+	/**
+	 * Writes text with out escaping.
+	 * @param text
+	 * @param expand <code>true</code> does variable expansion.
+	 * @return never <code>null</code>.
+	 */
+	public final T raw(String text, boolean expand) {
+		if (text != null) {
+			writeCurrentTag();
+			text = expand ? expand(text) : text;
+			write(text);
+		}
+		return getSelf();
+	}
+	
+	/**
+	 * Binds a named variables to be used for expansion in {@link #attr(String...) attributes} 
+	 * and {@link #text(String) text}. Variables are represented with by <code>${...}</code>.
+	 * <p>
+	 * <strong>Example</strong>
+	 * <pre>
+	 * bind("name", "Ferris");
+	 * text("${name}");
+	 * </pre>
+	 * <p>
+	 * <em>Variables are expanded in order and can be referred in a later binding.</em>
+	 * <p>
+	 * <pre>
+	 * bind("firstName", "Adam");
+	 * bind("lastName", "Gent");
+	 * bind("fullName", "${firstName} ${lastName}");
+	 * </pre>
+	 * @param name never <code>null</code> or empty.
+	 * @param value maybe <code>null</code>.
+	 * @return never <code>null</code>.
+	 */
+	public final T bind(String name, Object value) {
+		notEmpty(name);
+		Object v = value != null && value instanceof String ? expand(value.toString()) : value;
+	    bindings.put(name, v);
+	    return getSelf();
+	}
+	
+	/**
+	 * Removes a binding.
+	 * There is no failure if the binding does not exist.
+	 * @param name maybe <code>null</code>.
+	 * @return never <code>null</code>.
+	 * @see #bind(String, Object)
+	 */
+	public final T unbind(String name) {
+		if (bindings.containsKey(name))
+			bindings.remove(name);
+	    return getSelf();
+	}
+	
+	/**
+	 * Convenience for {@link #bind(String, Object)}
+	 * @param nvps never <code>null</code>.
+	 * @return never <code>null</code>.
+	 */
+	public final T bind(Collection<Entry<String, Object>> nvps) {
+	    for (Entry<String,Object> nvp : nvps) {
+	        bind(nvp.getKey(), nvp.getValue());
+	    }
+	    return getSelf();
+	}
+
+	/**
+	 * Starts a tag using the default closing policy {@link TagClosingPolicy#NORMAL}.
+	 * <p>
+	 * Equivalent to: {@code start("tag", TagClosingPolicy.NORMAL)}.
+	 * 
+	 * @param tag
+	 * @return this, never <code>null</code>.
+	 * @see #start(String, TagClosingPolicy)
+	 */
+	public final T start(String tag) {
+		return start(tag, TagClosingPolicy.NORMAL);
+	}
+	
+	/**
+	 * Starts a tag but does not immediately write it till the next
+	 * tag is started.
+	 * The {@link TagClosingPolicy} dictates whether or not the tag 
+	 * needs to be  {@link #end() closed}. Thus {@link #end()} does not need to be called
+	 * for all tags.
+	 * 
+	 * @param tag never <code>null</code> or empty.
+	 * @param policy never <code>null</code>.
+	 * @return never <code>null</code>.
+	 * @see #end()
+	 */
+	public final T start(String tag, TagClosingPolicy policy) {
+		writeCurrentTag();
+		Tag t = new Tag(tag);
+		t.closePolicy = policy;
+		t.depth = tagStack.size();
+		t.prefix = this.namespacePrefix;
+		tagStack.push(t);
+		return getSelf();
+	}
+	
+	/**
+	 * Adds attributes to the last {@link #start(String) start tag}.
+	 * Attributes do not need an {@link #end()} call.
+	 * @param attrs name value pairs. Its invalid for an odd number of arguments.
+	 * @return never <code>null</code>.
+	 * @throws IllegalArgumentException odd number of arguments.
+	 */
+	public final T attr(String ... attrs ) {
+		isTrue(attrs.length  % 2 == 0);
+		checkWriter();
+		for (int n = 0, v = 1; v < attrs.length; n+=2, v+=2) {
+			getAttributes().put(attrs[n], attrs[v]);
+		}
+		return getSelf();
+	}
+	
+	/**
+	 * Sets the default namespace on the last started tag.
+	 * @param uri if <code>null</code> nothing will happen.
+	 * @return this, never <code>null</code>.
+	 * @see #xmlns(String, String)
+	 */
+	public final T xmlns(String uri) {
+		return xmlns(uri, null);
+	}
+	
+	/**
+	 * Sets an XML namespace.
+	 * @param uri if <code>null</code> nothing will happen.
+	 * @param prefix if <code>null</code> or blank will act 
+	 * 	like the default namespace and no prefix. 
+	 * @return this, never <code>null</code>.
+	 */
+	public final T xmlns(String uri, String prefix) {
+		if (isBlank(uri)) return getSelf();
+		String n = isBlank(prefix) ? "xmlns" : prefix + ":xmlns";
+		return attr(n, uri);
+	}
+	
+	/**
+	 * Closes the inputed number of open tags.
+	 * @param i less than zero will do nothing.
+	 * @return never <code>null</code>.
+	 * @see #end()
+	 */
+	public final T end(int i) {
+		while ( i-- > 0 && ! tagStack.isEmpty() ) {
+			end();
+		}
+		return getSelf();
+	}
+	/**
+	 * Closes the last {@link #start(String) start tag}.
+	 * This is equivalent to <code></tag> or <tag/> depending
+	 *  on the {@link TagClosingPolicy}.
+	 * @return never <code>null</code>.
+	 * @see #start(String, TagClosingPolicy)
+	 * @see #endAll()
+	 * @see #done()
+	 */
+	public final T end() {
+		checkWriter();
+		Tag t = tagStack.peek();
+		writeStartTag(t);
+		writeEndTag(t);
+		tagStack.pop();
+		attributes.clear();
+		return getSelf();
+	}
+	
+	/**
+	 * Closes all open tags.
+	 * @return never <code>null</code>.
+	 * @see #end()
+	 */
+	public final T endAll() {
+		while( ! tagStack.isEmpty() ) {
+			end();
+		}
+		return getSelf();
+	}
+	
+	/**
+	 * Call when completely done with the builder.
+	 * This is required for nested builders.
+	 * <p>
+	 * If a builder is used again after {@code done()} is called
+	 * an exception (usually {@link IllegalArgumentException}) will be thrown.
+	 */
+	public final void done() {
+		endAll();
+		if (previousBuilder != null) {
+			isTrue(previousBuilder.writer == null, 
+					"The previous builder has its writer set. It should not.");
+			previousBuilder.writer = writer;
+		}
+		this.writer = null;
+	}
+	
+	/**
+	 * Writes immediately by passing the writer to each {@link MarkupWriter} 
+	 * in the order passed in.
+	 * @param writers never <code>null</code>, null elements passed in are ignored.
+	 * @return never <code>null</code>.
+	 * @since 0.2.2
+	 */
+	public final T write(MarkupWriter... writers) {
+		checkWriter();
+		int depth = 1 + (tagStack.isEmpty() ? 0 : tagStack.peek().depth);
+		writeCurrentTag();
+		notNull(writers, "writers");
+		for (MarkupWriter w : writers) {
+			if (w != null && w instanceof MarkupBuilderWriter) {
+				((MarkupBuilderWriter)w).write(this.writer, this.depth + depth);
+			}
+			else if (w != null) {
+				w.write(this.writer);
+			}
+		}
+		
+		return getSelf();
+	}
+	
+	private void writeCurrentTag() {
+		checkWriter();
+		if ( ! tagStack.isEmpty() ) {
+			Tag current = tagStack.peek();
+			if ( current.empty && ! current.end ) {
+				current.empty = current.closePolicy.isAlwaysSelfClosing();
+				writeStartTag(current);
+				if (current.closePolicy.isAlwaysSelfClosing()) {
+					end();
+				}
+			}
+		}
+		attributes.clear();
+	}
+	
+	private void writeStartTag(Tag t) {
+		if ( ! t.end  && ! t.start) {
+			writeIndent(t, TagIndentSpot.BEFORE_START_TAG);
+			writeTag(t.getQualifiedName(), t.isSelfClosing());
+			writeIndent(t, TagIndentSpot.AFTER_START_TAG);
+			if (t.isSelfClosing()) {
+				writeIndent(t, TagIndentSpot.AFTER_END_TAG);
+			}
+			t.end = t.isSelfClosing();
+			t.start = true;
+		}
+	}
+	
+	private void writeTag(String tag, boolean close) {
+		Map<String, String> attrs = getAttributes();
+		write("<" + tag);
+		if (attrs != null && ! attrs.isEmpty()) {
+			write(" ");
+			writeAttributes(attrs);
+		}
+		if (close)
+			write("/>");
+		else
+			write(">");
+	}
+	
+	private void writeEndTag(Tag t) {
+		if ( ! t.end ) {
+			writeIndent(t, TagIndentSpot.BEFORE_END_TAG);
+			write("</" + t.getQualifiedName() + ">");
+			t.end = true;
+			writeIndent(t, TagIndentSpot.AFTER_END_TAG);
+		}
+	}
+	
+	private void writeAttributes(Map<String, String> attrs) {
+		if (attrs == null) return;
+		boolean space = false;
+		for (Entry<String, String> attr : attrs.entrySet()) {
+			String key = attr.getKey();
+			String value = attr.getValue();
+			if (space) {
+				write(" ");
+			}
+			else {
+				space = true;
+			}
+			writeAttr(key,value);
+		}
+	}
+	private void writeAttr(String name, String value) {
+		if (value != null && name != null) {
+			write(expand(name + "=" + q(value)));
+		}		
+	}
+	private String q(String raw) {
+		return q + escapeAttributeMarkup(expand(raw)) + q;
+	}
+	
+	private String expand(String text) {
+	    StrSubstitutor s = new StrSubstitutor(bindings);
+	    return s.replace(text);
+	}
+	
+	private void write(String raw) {
+		checkWriter();
+		try {
+			writer.write(raw);
+		} catch (IOException e) {
+			throw new RuntimeException("Writer for Builder failed:", e);
+		}
+	}
+	private void checkWriter() {
+		notNull(writer, "The writer has not been seet " +
+				"or is in use by another builder.");
+	}
+	private Map<String, String> createMap() {
+		return new LinkedHashMap<String, String>();
+	}
+	
+	/**
+	 * DEPRECATED.
+	 * @param raw maybe <code>null</code>.
+	 * @return maybe <code>null</code> if null for input.
+	 * @see #text(String)
+	 * @deprecated Please use {@link #escapeElementMarkup(String)} and {@link #escapeAttributeMarkup(String)}
+	 */
+	protected String escapeMarkup(String raw) {
+		return MarkupUtils.escapeElementEntities(raw);
+	}
+	
+	/**
+	 * The strategy for escaping element markup. 
+	 * The default is escape for XML.
+	 * @param raw maybe <code>null</code>.
+	 * @return maybe <code>null</code> if null for input.
+	 * @see #text(String)
+	 * @see #escapeAttributeMarkup(String)
+	 */
+	@SuppressWarnings("deprecation")
+	protected String escapeElementMarkup(String raw) {
+		return escapeMarkup(raw);
+	}
+	
+	/**
+	 * The strategy for escaping attribute markup.
+	 * The default escaping is XML. 
+	 * Entities will be used for white space characters:
+	 * <code>#xD, #xA, #x9</code><p>
+	 * CR, newline, and tab, respectively.
+	 * @param raw maybe <code>null</code>.
+	 * @return maybe <code>null</code> if null for input.
+	 */
+	protected String escapeAttributeMarkup(String raw) {
+		return MarkupUtils.escapeAttributeEntities(raw);
+	}
+	
+	private void writeIndent(
+			Tag t,
+			TagIndentSpot spot) {
+		try {
+			indenter.indentTag(this.writer, t.depth, this.depth, 
+					spot, t.name, t.closePolicy, t.empty);
+		} catch (IOException e) {
+			throw new RuntimeException("Builder Indenting failed:", e);
+		}	
+	}
+	
+	/**
+	 * A default indenter that uses tabs.
+	 */
+	protected static Indenter indentOn = new SimpleIndenter("\n", "\t", "\n", "\t");
+	/**
+	 * An indenter that turns off indenting.
+	 */
+	protected static Indenter indentOff = new SimpleIndenter(null, null, null, null);
+	/**
+	 * Indents by keeping a tag pair on the same line. 
+	 */
+	protected static Indenter indentSameLine = new SimpleIndenter("\n", "\t", null, null);
+	
+	private static class Tag {
+		
+		public Tag(String name) {
+			super();
+			this.name = name;
+		}
+		public int depth = 0;
+		public String name;
+		public String prefix;
+		public boolean empty = true;
+		public boolean start = false;
+		public boolean end = false;
+		
+		public TagClosingPolicy closePolicy = TagClosingPolicy.NORMAL;
+		
+		public String getQualifiedName() {
+			return isBlank(this.prefix) || this.name.contains(":") ? this.name : 
+				this.prefix + ":"  + this.name;
+		}
+		
+		public boolean isSelfClosing() {
+			return empty && closePolicy.isSelfClosing();
+		}
+		
+	}
+	
+	/**
+	 * Policy for how tags should be closed.
+	 * @author adamgent
+	 *
+	 */
+	public enum TagClosingPolicy {
+		/**
+		 * The tag can either be closed with a matching closing tag
+		 * or self closing. It will be self closing if the tag contains
+		 * no child tags or text.
+		 * <ul>
+		 * <li><code><tag/></code></li>
+		 * <li><code></tag></code></li>
+		 * </ul>
+		 * <em>Unlike {@link #SELF self closing} tags a {@link #NORMAL} tag must be explicitly closed.</em>
+		 */
+		NORMAL,
+		
+		/**
+		 * The tag is always a self closing tag.
+		 * <ul>
+		 * <li><code><tag/></code></li>
+		 * </ul>
+		 * <em>When a tag has this policy the tag can be implicitly closed 
+		 * by {@link MarkupBuilder#start(String, TagClosingPolicy) starting the next tag}:</em><p>
+		 * <pre>
+		 * start("self",TagClosingPolicy.SELF).start("next");
+		 * </pre>
+		 * Result:<p>
+		 * <pre>
+		 * <self/>
+		 * <next>
+		 * ...
+		 * </pre>
+		 * 
+		 */
+		SELF,
+		/**
+		 * The tag is always closed with a matching closing tag
+		 * regardless if there is no child tag or text.
+		 * <ul>
+		 * <li><code><tag/></code></li>
+		 * </ul>
+		 */
+		PAIR;
+		
+		public final boolean isAlwaysSelfClosing() {
+			return this == SELF;
+		}
+		
+		/**
+		 * @return <code>true</code> if the tag is allowed to self close.
+		 */
+		public final boolean isSelfClosing() {
+			return this == SELF || this == NORMAL;
+		}
+		
+		/**
+		 * @return <code>true</code> if the tag is allowed to close with a matching end tag (<code></tag></code>).
+		 */
+		public final boolean isPairClosing() {
+			return this == PAIR || this == NORMAL;
+		}
+	}
+
+}
diff --git a/src/main/java/com/googlecode/jatl/MarkupBuilderWriter.java b/src/main/java/com/googlecode/jatl/MarkupBuilderWriter.java
new file mode 100644
index 0000000..1f9021d
--- /dev/null
+++ b/src/main/java/com/googlecode/jatl/MarkupBuilderWriter.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright (C) 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.googlecode.jatl;
+
+import java.io.Writer;
+
+
+/**
+ * 
+ * The methods in this class will be merged with {@link MarkupWriter} in 0.3.0.
+ * <p>
+ * Thus this interface will be deprecated in the next release.
+ * @author agent
+ * @since 0.2.2
+ *
+ */
+public interface MarkupBuilderWriter extends MarkupWriter {
+	/**
+	 * Writes using the given writer at the given depth.
+	 * The writer should not be closed and will not be closed by implementations.
+	 * Its up to the caller to close the writer.
+	 * @param <W> writer type.
+	 * @param depth the indent depth to start at.
+	 * @param writer not null.
+	 * @return the writer used for fluent style.
+	 * @since 0.2.2
+	 * @see MarkupBuilder#write(MarkupWriter...)
+	 */
+	public <W extends Writer> W  write(W writer, int depth);
+}
diff --git a/src/main/java/com/googlecode/jatl/MarkupUtils.java b/src/main/java/com/googlecode/jatl/MarkupUtils.java
new file mode 100644
index 0000000..98ebac3
--- /dev/null
+++ b/src/main/java/com/googlecode/jatl/MarkupUtils.java
@@ -0,0 +1,171 @@
+/**
+ * Copyright (C) 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.googlecode.jatl;
+
+/**
+ * XML Utils.
+ * 
+ * @author agent
+ * 
+ */
+public final class MarkupUtils {
+
+	private MarkupUtils() {
+	}
+	
+	/**
+	 * This will take the three pre-defined entities in XML 1.0 (used
+	 * specifically in XML elements) and convert their character representation
+	 * to the appropriate entity reference, suitable for XML element content.
+	 * 
+	 * @param str
+	 *            <code>String</code> input to escape.
+	 * @return <code>String</code> with escaped content.
+	 * @author THIS CODE WAS INSPIRED FROM JDOM http://www.jdom.org/
+	 */
+	public static String escapeElementEntities(String str) {
+		if (str == null) return null;
+		StringBuffer buffer;
+		char ch;
+		String entity;
+
+		buffer = null;
+		for (int i = 0; i < str.length(); i++) {
+			ch = str.charAt(i);
+			switch (ch) {
+				case '<':
+					entity = "<";
+					break;
+				case '>':
+					entity = ">";
+					break;
+				case '&':
+					entity = "&";
+					break;
+				case '\r':
+					entity = "&#xD;";
+					break;
+				// case '\n' :
+				// entity = currentFormat.lineSeparator;
+				// break;
+				default:
+					entity = null;
+					break;
+			}
+			if (buffer == null) {
+				if (entity != null) {
+					// An entity occurred, so we'll have to use StringBuffer
+					// (allocate room for it plus a few more entities).
+					buffer = new StringBuffer(str.length() + 20);
+					// Copy previous skipped characters and fall through
+					// to pickup current character
+					buffer.append(str.substring(0, i));
+					buffer.append(entity);
+				}
+			}
+			else {
+				if (entity == null) {
+					buffer.append(ch);
+				}
+				else {
+					buffer.append(entity);
+				}
+			}
+		}
+
+		// If there were any entities, return the escaped characters
+		// that we put in the StringBuffer. Otherwise, just return
+		// the unmodified input string.
+		return (buffer == null) ? str : buffer.toString();
+	}
+
+	/**
+	 * 
+	 * This will take the pre-defined entities in XML 1.0 and convert their
+	 * character representation to the appropriate entity reference, suitable
+	 * for XML attributes. It does not convert the single quote (') because it's
+	 * not necessary as the outputter writes attributes surrounded by
+	 * double-quotes.
+	 * 
+	 * @param str
+	 *            <code>String</code> input to escape.
+	 * @return <code>String</code> with escaped content.
+	 * @author THIS CODE WAS INSPIRED FROM JDOM http://www.jdom.org/
+	 */
+	public static String escapeAttributeEntities(String str) {
+		if (str == null) return null;
+		StringBuffer buffer;
+		char ch;
+		String entity;
+
+		buffer = null;
+		for (int i = 0; i < str.length(); i++) {
+			ch = str.charAt(i);
+			switch (ch) {
+				case '<':
+					entity = "<";
+					break;
+				case '>':
+					entity = ">";
+					break;
+				case '\"':
+					entity = """;
+					break;
+				case '&':
+					entity = "&";
+					break;
+				case '\r':
+					entity = "&#xD;";
+					break;
+				case '\t':
+					entity = "&#x9;";
+					break;
+				case '\n':
+					entity = "&#xA;";
+					break;
+				default:
+					entity = null;
+					break;
+			}
+			if (buffer == null) {
+				if (entity != null) {
+					// An entity occurred, so we'll have to use StringBuffer
+					// (allocate room for it plus a few more entities).
+					buffer = new StringBuffer(str.length() + 20);
+					// Copy previous skipped characters and fall through
+					// to pickup current character
+					buffer.append(str.substring(0, i));
+					buffer.append(entity);
+				}
+			}
+			else {
+				if (entity == null) {
+					buffer.append(ch);
+				}
+				else {
+					buffer.append(entity);
+				}
+			}
+		}
+
+		// If there were any entities, return the escaped characters
+		// that we put in the StringBuffer. Otherwise, just return
+		// the unmodified input string.
+		return (buffer == null) ? str : buffer.toString();
+	}
+
+}
diff --git a/src/main/java/com/googlecode/jatl/MarkupWriter.java b/src/main/java/com/googlecode/jatl/MarkupWriter.java
new file mode 100644
index 0000000..9c11b3e
--- /dev/null
+++ b/src/main/java/com/googlecode/jatl/MarkupWriter.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright (C) 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.googlecode.jatl;
+
+import java.io.Writer;
+
+/**
+ * 
+ * Wrap builders for deferred writing.
+ * <p>
+ * This is useful when you want to define the markup but do not
+ * have the {@link Writer} yet. 
+ * <p> Often this is the case when:
+ * <ul>
+ * <p>
+ * <li>MVC framework (such as Spring MVC) where the writer is not available
+ * till rendering time. </li>
+ * <li>Composition of builders.</li>
+ * </ul>
+ * You can achieve functional composition of markup builders by creating methods that return {@link MarkupWriter}s.
+ * <pre>
+	private HtmlWriter createInput(final String name, final String value) {
+		return new HtmlWriter() {
+			protected void build() {
+				input().name(name).value(value).end();
+			}
+		};
+	}
+	
+	private HtmlWriter createForm(final HtmlWriter ... inputs) {
+		return new HtmlWriter() {
+			protected void build() {
+				form().write(inputs).end();
+			}
+		};
+	}
+ * </pre>
+ * See {@link MarkupBuilder#write(MarkupWriter...)}
+ * <p>
+ * @author agent
+ * @see HtmlWriter
+ * @see MarkupBuilder#write(MarkupWriter...)
+ */
+public interface MarkupWriter {
+	/**
+	 * Writes using the given writer. 
+	 * The writer should not be closed and will not be closed by implementations.
+	 * Its up to the caller to close the writer.
+	 * @param <W> writer type.
+	 * @param writer not null.
+	 * @return the writer used for fluent style.
+	 */
+	public <W extends Writer> W  write(W writer);
+}
diff --git a/src/main/java/com/googlecode/jatl/SimpleIndenter.java b/src/main/java/com/googlecode/jatl/SimpleIndenter.java
new file mode 100644
index 0000000..bf2a292
--- /dev/null
+++ b/src/main/java/com/googlecode/jatl/SimpleIndenter.java
@@ -0,0 +1,81 @@
+/**
+ * Copyright (C) 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.googlecode.jatl;
+
+import java.io.IOException;
+
+/**
+ * 
+ * A simple indenter that takes a String for 
+ * before and after on the opening and closing tag.
+ * <p>
+ * <b>EXPERIMENTAL MAY CHANGE</b>
+ * 
+ * @author agent
+ *
+ */
+public class SimpleIndenter implements Indenter {
+
+	private String startTagNewLine =  "\n";
+	private String startTagIndent = "\t";
+	private String endTagNewLine = "\n";
+	private String endTagIndent = "\t";
+	
+	/**
+	 * 
+	 * <b>EXPERIMENTAL MAY CHANGE</b>
+	 * 
+	 * @param startTagNewLine null not recommended.
+	 * @param startTagIndent null not recommended.
+	 * @param endTagNewLine null not recommended.
+	 * @param endTagIndent null not recommended.
+	 */
+	public SimpleIndenter(String startTagNewLine, String startTagIndent, String endTagNewLine, String endTagIndent) {
+		super();
+		this.startTagNewLine = startTagNewLine;
+		this.startTagIndent = startTagIndent;
+		this.endTagNewLine = endTagNewLine;
+		this.endTagIndent = endTagIndent;
+	}
+
+	/**
+	 * {@inheritDoc}
+	 */
+	public void indentTag(Appendable a, int innerDepth, int outerDepth, TagIndentSpot spot, String tag,
+			MarkupBuilder.TagClosingPolicy p, boolean empty) throws IOException {
+		int depth = innerDepth + outerDepth;
+		if (spot == TagIndentSpot.BEFORE_START_TAG ) {
+			if (startTagNewLine != null)
+				a.append(startTagNewLine);
+			if (startTagIndent != null) {
+				for (int i = 0; i < depth; i++) {
+					a.append(startTagIndent);
+				}
+			}
+		}
+		if (spot == TagIndentSpot.BEFORE_END_TAG ) {
+			if (endTagNewLine != null)
+				a.append(endTagNewLine);
+			if (endTagIndent != null) {
+				for (int i = 0; i < depth; i++) {
+					a.append(endTagIndent);
+				}
+			}
+		}			
+	}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/googlecode/jatl/package-info.java b/src/main/java/com/googlecode/jatl/package-info.java
new file mode 100644
index 0000000..df64b01
--- /dev/null
+++ b/src/main/java/com/googlecode/jatl/package-info.java
@@ -0,0 +1,49 @@
+/**
+ * Copyright (C) 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * For quickstart documentation: <a href="http://jatl.googlecode.com/">http://jatl.googlecode.com/</a> and {@link com.googlecode.jatl.MarkupBuilder}.
+ * <p>
+ * <strong>Example</strong><p>
+ * <pre>
+	StringWriter sw = new StringWriter();
+	new Html(sw) {{
+		div().title("first");
+			span().id("hello").end();
+			div().title("second");
+				text("Second");
+				start("custom1").attr("data", "value").end();
+				start("custom2").text("hello").end();
+			end();
+		end();
+	}};
+	String result = sw.getBuffer().toString();
+	String expected = "\n" + 
+			"<div title=\"first\">\n" + 
+			"	<span id=\"hello\"/>\n" + 
+			"	<div title=\"second\">Second\n" + 
+			"		<custom1 data=\"value\"/>\n" + 
+			"		<custom2>hello\n" + 
+			"		</custom2>\n" + 
+			"	</div>\n" + 
+			"</div>";
+	assertEquals(expected, result);
+ * </pre>
+ * <p>
+ * See {@link com.googlecode.jatl.MarkupBuilder} for creating your own markup builders.
+ */
+package com.googlecode.jatl;
+
diff --git a/src/test/java/com/googlecode/jatl/CustomHtmlBuilderTest.java b/src/test/java/com/googlecode/jatl/CustomHtmlBuilderTest.java
new file mode 100644
index 0000000..bb96661
--- /dev/null
+++ b/src/test/java/com/googlecode/jatl/CustomHtmlBuilderTest.java
@@ -0,0 +1,92 @@
+/**
+ * Copyright (C) 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.googlecode.jatl;
+
+import static org.junit.Assert.*;
+
+import java.io.StringWriter;
+import java.io.Writer;
+
+import org.junit.Test;
+
+public class CustomHtmlBuilderTest {
+	
+	/**
+	 * My own custom HTML Builder.
+	 * This is akin to making a JQuery plugin
+	 * except that Java does not have mixins (Traits).
+	 * 
+	 * @author agent
+	 *
+	 */
+	public abstract static class CustomBuilder<T> extends HtmlBuilder<T> {
+		
+		
+		/*
+		 * Put Custom methods here.
+		 * This where you can do composition.
+		 * A slight annoyance is that you cannot do dotted notation.
+		 */
+		
+		public CustomBuilder(Writer writer) {
+			super(writer);
+		}
+
+		public T list(String ... ss) {
+			ul();
+			for (String s : ss) {
+				li(); text(s); end();
+			}
+			end();
+			return getSelf();
+		}
+	}
+	
+	public static class Custom extends CustomBuilder<Custom> {
+		
+		
+		public Custom(Writer writer) {
+			super(writer);
+		}
+
+		@Override
+		protected Custom getSelf() {
+			return this;
+		}
+	
+	}
+	
+	@Test
+	public void testCustom() throws Exception {
+		StringWriter sw = new StringWriter();
+		new Custom(sw) {{
+			div().list("Tom", "Dick", "Jane").endAll();
+		}};
+		assertEquals("\n" + 
+				"<div>\n" + 
+				"	<ul>\n" + 
+				"		<li>Tom\n" + 
+				"		</li>\n" + 
+				"		<li>Dick\n" + 
+				"		</li>\n" + 
+				"		<li>Jane\n" + 
+				"		</li>\n" + 
+				"	</ul>\n" + 
+				"</div>", sw.toString());
+	}
+
+}
diff --git a/src/test/java/com/googlecode/jatl/HtmlBuilderTest.java b/src/test/java/com/googlecode/jatl/HtmlBuilderTest.java
new file mode 100644
index 0000000..4e99d47
--- /dev/null
+++ b/src/test/java/com/googlecode/jatl/HtmlBuilderTest.java
@@ -0,0 +1,642 @@
+/**
+ * Copyright (C) 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.googlecode.jatl;
+
+import static java.util.Arrays.asList;
+import static org.junit.Assert.*;
+
+import java.io.StringWriter;
+import java.io.Writer;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class HtmlBuilderTest {
+	StringWriter sw = new StringWriter();
+	StringWriter writer = sw;
+	Html html = new Html(sw);
+	
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	
+	@Test
+	public void testFluentHtml() {
+		html
+			.div()
+			.select().id("adam").name("adam")
+			.option("Hello", "1", true)
+			.option("Crap", "2", false)
+			.br()
+			.endAll();
+		String result = sw.getBuffer().toString();
+		String expected = 
+				"\n" + 
+				"<div>\n" + 
+				"	<select id=\"adam\" name=\"adam\">\n" + 
+				"		<option value=\"1\" selected=\"selected\">Hello\n" +
+				"		</option>\n" +
+				"		<option value=\"2\">Crap\n" + 
+				"		</option>\n" + 
+				"		<br/>\n" +
+				"	</select>\n" + 
+				"</div>";
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testFluentHtmlEndWithArg() {
+		html
+			.div()
+			.select().id("adam").name("adam")
+			.option("Hello", "1", true)
+			.end(3);
+		
+		String result = sw.getBuffer().toString();
+		String expected = 
+				"\n" + 
+				"<div>\n" + 
+				"	<select id=\"adam\" name=\"adam\">\n" + 
+				"		<option value=\"1\" selected=\"selected\">Hello\n" +
+				"		</option>\n" + 
+				"	</select>\n" + 
+				"</div>";
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testFluentHtmlCheckbox() {
+		html
+			.div()
+			.checkbox()
+				.name("adam")
+				.value("crap")
+			.checkbox()
+			.endAll();
+		String result = sw.getBuffer().toString();
+		String expected = "\n" + 
+				"<div>\n" + 
+				"	<input type=\"checkbox\" name=\"adam\" value=\"crap\"/>\n" + 
+				"	<input type=\"checkbox\"/>\n" + 
+				"</div>";
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testAnonClassHtml() {
+		new Html(sw) {{
+			div().title("first");
+				span().id("hello").end();
+				div().title("second");
+					text("Second");
+					start("custom1").attr("data", "value").end();
+					start("custom2").text("hello").end();
+				end();
+			end();
+		}};
+		String result = sw.getBuffer().toString();
+		String expected = "\n" + 
+				"<div title=\"first\">\n" + 
+				"	<span id=\"hello\"/>\n" + 
+				"	<div title=\"second\">Second\n" + 
+				"		<custom1 data=\"value\"/>\n" + 
+				"		<custom2>hello\n" + 
+				"		</custom2>\n" + 
+				"	</div>\n" + 
+				"</div>";
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testExample() throws Exception {
+		//From http://codemonkeyism.com/the-best-markup-builder-i-could-build-in-java/
+		new Html(writer) {{
+		    bind("id", "foo");
+		    bind("coolName", "Awesomo");
+			html();
+				body();
+    				h1().text("Name Games").end();
+    				p().id("${id}").text("Hello ${coolName}, and hello").end();
+    			makeList("Kyle","Stan", "Eric", "${coolName}");
+    		endAll();
+			done();
+		}
+			Html makeList(String ... names) {
+				ul();
+				for(String name : names) {
+					li().text(name).end();
+				}
+				return end();
+			}
+		};
+		String result = writer.getBuffer().toString();
+		String expected = "\n" + 
+				"<html>\n" + 
+				"	<body>\n" + 
+				"		<h1>Name Games\n" + 
+				"		</h1>\n" + 
+				"		<p id=\"foo\">Hello Awesomo, and hello\n" + 
+				"		</p>\n" + 
+				"		<ul>\n" + 
+				"			<li>Kyle\n" + 
+				"			</li>\n" + 
+				"			<li>Stan\n" + 
+				"			</li>\n" + 
+				"			<li>Eric\n" + 
+				"			</li>\n" + 
+				"			<li>Awesomo\n" + 
+				"			</li>\n" + 
+				"		</ul>\n" + 
+				"	</body>\n" + 
+				"</html>";
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testNestedBuilder() throws Exception {
+		new Html(writer) {{
+		    bind("id", "foo");
+		    bind("coolName", "Awesomo");
+			html();
+				body();
+    				h1().text("${coolName}").end();
+    				new MyMarkup(this) {{
+    					div().text("this ${coolName} should not be surround by a html div");
+    					done();
+    				}};
+			done();
+		}};
+		String result = writer.getBuffer().toString();
+		String expected = "\n" + 
+				"<html>\n" + 
+				"	<body>\n" + 
+				"		<h1>Awesomo\n" + 
+				"		</h1>\n" + 
+				"		<divide>this Awesomo should not be surround by a html div\n" + 
+				"		</divide>\n" + 
+				"	</body>\n" + 
+				"</html>";
+		assertEquals(expected, result);
+	}
+	
+	public static class MyMarkup extends MarkupBuilder<MyMarkup> {
+
+		public MyMarkup(MarkupBuilder<?> builder) {
+			super(builder);
+		}
+
+		@Override
+		protected MyMarkup getSelf() {
+			return this;
+		}
+		
+		public MyMarkup div() {
+			return start("divide");
+		}
+	}
+	
+	@Test
+	public void testBuilderResuming() throws Exception {
+		/*
+		 * Builder resuming is kind of dangerous.
+		 */
+		Html page = new Html(writer);
+		/*
+		 * Do the header first.
+		 */
+		page = new Html(page, false) {{
+			html().head().end();
+			body();
+		}};
+		/*
+		 * Body.
+		 */
+		page = new Html(page, false) {{
+			h1().text("Hello World").end();
+		}};
+		/*
+		 * Do the footer
+		 */
+		page = new Html(page, false) {{
+			end();
+			end();
+		}};
+		
+		String result = writer.getBuffer().toString();
+		String expected = "\n" + 
+				"<html>\n" + 
+				"	<head>\n" + 
+				"	</head>\n" + 
+				"	<body>\n" + 
+				"		<h1>Hello World\n" + 
+				"		</h1>\n" + 
+				"	</body>\n" + 
+				"</html>";
+		assertEquals(expected, result);
+		
+	}
+	
+	@Test(expected=IllegalArgumentException.class)
+	public void setWriter() throws Exception {
+		Html h = new Html(writer) {{
+			div().text("hello").end();
+			done();
+		}};
+		h.setWriter(null);
+	}
+	@Test(expected=IllegalArgumentException.class)
+	public void testInvalidAttributes() throws Exception {
+		new Html(writer) {{
+			div().attr("data","stuff","cat");
+		}};		
+	}
+	
+	@Test
+	public void testMultiAttributes() throws Exception {
+		new Html(writer) {{
+			div().attr("id", "top", "data", "{'a' : 'b>'}");
+			done();
+		}};
+		String actual = writer.getBuffer().toString();
+		String expected = "\n" + 
+				"<div id=\"top\" data=\"{'a' : 'b>'}\">\n" + 
+				"</div>";
+		assertEquals(expected, actual);
+	}
+	
+	@Test(expected=IllegalArgumentException.class)
+	public void testNullWriter() throws Exception {
+		new Html((Writer)null) {{
+		
+		}};
+	}
+	
+	@Test
+	public void testRaw() throws Exception {
+		new Html(writer) {{
+			html().head().end().body().h1().text("hello").end();
+			div().raw("<crap></crap>").end();
+			endAll();
+		}};
+		String result = writer.getBuffer().toString();
+		String expected = "\n" + 
+				"<html>\n" + 
+				"	<head>\n" + 
+				"	</head>\n" + 
+				"	<body>\n" + 
+				"		<h1>hello\n" + 
+				"		</h1>\n" + 
+				"		<div><crap></crap>\n" + 
+				"		</div>\n" + 
+				"	</body>\n" + 
+				"</html>";
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testRawExpand() throws Exception {
+		new Html(writer) {{
+			bind("name", "Adam");
+			html().head().end().body().h1().text("hello").end();
+			div().raw("<crap>${name}</crap>", true).end();
+			endAll();
+		}};
+		String result = writer.getBuffer().toString();
+		String expected = "\n" + 
+				"<html>\n" + 
+				"	<head>\n" + 
+				"	</head>\n" + 
+				"	<body>\n" + 
+				"		<h1>hello\n" + 
+				"		</h1>\n" + 
+				"		<div><crap>Adam</crap>\n" + 
+				"		</div>\n" + 
+				"	</body>\n" + 
+				"</html>";
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testEscapeText() throws Exception {
+		new Html(writer) {{
+			html().head().end().body().h1().text("hello").end();
+			div().text("<crap></crap>").end();
+			done();
+		}};
+		String result = writer.getBuffer().toString();
+		String expected = "\n" + 
+				"<html>\n" + 
+				"	<head>\n" + 
+				"	</head>\n" + 
+				"	<body>\n" + 
+				"		<h1>hello\n" + 
+				"		</h1>\n" + 
+				"		<div><crap></crap>\n" + 
+				"		</div>\n" + 
+				"	</body>\n" + 
+				"</html>";
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testVariableBinding() throws Exception {
+		new Html(writer) {{
+			bind("first", "Adam").bind("last", "Gent");
+			bind("full", "${first} ${last}");
+			text("My name is ${full} but just call me ${first}."); 
+		}};
+		String result = writer.getBuffer().toString();
+		String expected = "My name is Adam Gent but just call me Adam.";
+		assertEquals(result, expected);
+	}
+	@Test
+	public void testNamespace() throws Exception {
+		new Html(writer) {{
+			html()
+				.xmlns("http://www.w3.org/1999/xhtml")
+				.xmlns("http://www.w3.org/1999/XSL/Transform", "xsl")
+				.attr("xml:lang", "en")
+				.attr("lang","en");
+			ns("xsl");
+			start("template").attr("match", "body");
+				text("blah");
+				ns();
+				//Should have xsl prefix
+				span().end();
+			end();
+			start("xsl:template").attr("match", "title");
+				text("blah");
+			end();
+			ns(null);
+			div().text("no prefix");
+			done();
+		}};
+		
+		String result = writer.getBuffer().toString();
+		String expected = "\n" + 
+				"<html xmlns=\"http://www.w3.org/1999/xhtml\" " +
+				"xsl:xmlns=\"http://www.w3.org/1999/XSL/Transform\" xml:lang=\"en\" lang=\"en\">\n" + 
+				"	<xsl:template match=\"body\">blah\n" + 
+				"		<xsl:span/>\n" + 
+				"	</xsl:template>\n" + 
+				"	<xsl:template match=\"title\">blah\n" + 
+				"	</xsl:template>\n" + 
+				"	<div>no prefix\n" + 
+				"	</div>\n" + 
+				"</html>";
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testTable() throws Exception {
+		new Html(writer) {{
+			table().width("100%").height("100%");
+			thead().tr();
+			for (String header : asList("A","B","C")) {
+				th().text(header).end();
+			}
+			end().end();
+			tbody();
+			for (int i = 0; i < 3; i++) {
+				tr();
+				for(String cell : asList("a","b","c")) {
+					td().text(cell).end();
+				}
+				end();
+			}
+			done();
+		}};
+		
+		String result = writer.getBuffer().toString();
+		String expected = "\n" + 
+				"<table width=\"100%\" height=\"100%\">\n" + 
+				"	<thead>\n" + 
+				"		<tr>\n" + 
+				"			<th>A\n" + 
+				"			</th>\n" + 
+				"			<th>B\n" + 
+				"			</th>\n" + 
+				"			<th>C\n" + 
+				"			</th>\n" + 
+				"		</tr>\n" + 
+				"	</thead>\n" + 
+				"	<tbody>\n" + 
+				"		<tr>\n" + 
+				"			<td>a\n" + 
+				"			</td>\n" + 
+				"			<td>b\n" + 
+				"			</td>\n" + 
+				"			<td>c\n" + 
+				"			</td>\n" + 
+				"		</tr>\n" + 
+				"		<tr>\n" + 
+				"			<td>a\n" + 
+				"			</td>\n" + 
+				"			<td>b\n" + 
+				"			</td>\n" + 
+				"			<td>c\n" + 
+				"			</td>\n" + 
+				"		</tr>\n" + 
+				"		<tr>\n" + 
+				"			<td>a\n" + 
+				"			</td>\n" + 
+				"			<td>b\n" + 
+				"			</td>\n" + 
+				"			<td>c\n" + 
+				"			</td>\n" + 
+				"		</tr>\n" + 
+				"	</tbody>\n" + 
+				"</table>";
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testHeaders() throws Exception {
+		new Html(writer) {{
+			String title = "Header ";
+			int i = 1;
+			h1().text(title + i++ ).end();
+			h2().text(title + i++).end();
+			h3().text(title + i++).end();
+			h4().text(title + i++).end();
+			h5().text(title + i++).end();
+			h6().text(title + i++).end();
+		}};
+		String result = writer.getBuffer().toString();
+		String expected = "\n" + 
+				"<h1>Header 1\n" + 
+				"</h1>\n" + 
+				"<h2>Header 2\n" + 
+				"</h2>\n" + 
+				"<h3>Header 3\n" + 
+				"</h3>\n" + 
+				"<h4>Header 4\n" + 
+				"</h4>\n" + 
+				"<h5>Header 5\n" + 
+				"</h5>\n" + 
+				"<h6>Header 6\n" + 
+				"</h6>";
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testHead() throws Exception {
+		new Html(writer) {{
+			head();
+				title().text("Hello World").end();
+				link().href("http://").media("screen").rel("stylesheet").type("text/css");
+				meta().name("medium").content("blog");
+				script().type("text/javascript").src("blah.js").end();
+				style().type("text/css")
+					.text("");
+			done();
+		}};
+		String result = writer.getBuffer().toString();
+		String expected = "\n" + 
+				"<head>\n" + 
+				"	<title>Hello World\n" + 
+				"	</title>\n" + 
+				"	<link href=\"http://\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\"/>\n" + 
+				"	<meta name=\"medium\" content=\"blog\"/>\n" + 
+				"	<script type=\"text/javascript\" src=\"blah.js\">\n" + 
+				"	</script>\n" + 
+				"	<style type=\"text/css\">\n" + 
+				"	</style>\n" + 
+				"</head>";
+		assertEquals(expected, result);
+	}
+	
+	@Test //http://code.google.com/p/jatl/issues/detail?id=3
+	public void testIssue3() throws Exception {
+		new Html(writer).div().textarea().cols("1").rows("1").end().text("Message:").end();
+		String result = writer.getBuffer().toString();
+		String expected ="\n" + 
+				"<div>\n" + 
+				"	<textarea cols=\"1\" rows=\"1\">\n" + 
+				"	</textarea>Message:\n" + 
+				"</div>";
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testIndenter() throws Exception {
+		new Html(writer) {{
+			bind("name", "Adam");
+			html().head().indent(indentSameLine).end().body().indent(indentOn).h1().indent(indentOff).text("hello").end();
+			div().indent(indentOn).raw("<crap>${name}</crap>", true).end();
+			endAll();
+		}};
+		String result = writer.getBuffer().toString();
+		String expected = "\n" + 
+				"<html>\n" + 
+				"	<head></head>\n" + 
+				"	<body><h1>hello</h1>\n" + 
+				"		<div><crap>Adam</crap>\n" + 
+				"		</div>\n" + 
+				"	</body>\n" + 
+				"</html>";
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testCustomIndenter() throws Exception {
+		final Indenter indenter = new SimpleIndenter("\n", "\t", "", "");
+		new Html(writer) {{
+			int i = 1;
+			indent(indentOff).html().body().indent(indenter);
+			table();
+			tr();
+				td().text("" + i++).end();
+				td().text("" + i++).end();
+			end();
+			tr();
+				td().text("" + i++).end();
+			endAll();
+		}};
+		String result = writer.getBuffer().toString();
+		String expected = "<html>\n" + 
+				"	<body>\n" + 
+				"		<table>\n" + 
+				"			<tr>\n" + 
+				"				<td>1</td>\n" + 
+				"				<td>2</td></tr>\n" + 
+				"			<tr>\n" + 
+				"				<td>3</td></tr></table></body></html>";
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testCustomIndenterIssue13() throws Exception {
+		final Indenter indenter = new SimpleIndenter("\n", "\t", "", "");
+		new Html(writer) {{
+			int i = 1;
+			indent(indentOff).html().body().indent(indenter);
+			table();
+			tr();
+				td().text("" + i++).end();
+				td().text("" + i++).end();
+			end();
+			tr();
+				td().text("" + i++).end();
+			endAll();
+		}};
+		String result = writer.getBuffer().toString();
+		String expected = "<html>\n" + 
+				"	<body>\n" + 
+				"		<table>\n" + 
+				"			<tr>\n" + 
+				"				<td>1</td>\n" + 
+				"				<td>2</td></tr>\n" + 
+				"			<tr>\n" + 
+				"				<td>3</td></tr></table></body></html>";
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testAttributeWhitespaceEscaping() throws Exception {
+		new Html(writer) {{
+			html().head().end();
+			input().value("hello\012world");
+			input().value("hello\t\tworld");
+			done();
+		}};
+		String result = writer.getBuffer().toString();
+		String expected = "\n" + 
+				"<html>\n" + 
+				"	<head>\n" + 
+				"	</head>\n" + 
+				"	<input value=\"hello&#xA;world\"/>\n" + 
+				"	<input value=\"hello&#x9;&#x9;world\"/>\n" + 
+				"</html>";
+		assertEquals(expected, result);		
+	}
+	
+	@Test
+	public void testIssue16Iframe() {
+		new Html(writer) {{
+			iframe().src("http://www.google.com").end();
+			done();
+		}};
+		String result = writer.getBuffer().toString();
+		String expected = "\n" + 
+				"<iframe src=\"http://www.google.com\">\n" + 
+				"</iframe>";
+		assertEquals(expected, result);
+	}
+	
+}
diff --git a/src/test/java/com/googlecode/jatl/HtmlWriterTest.java b/src/test/java/com/googlecode/jatl/HtmlWriterTest.java
new file mode 100644
index 0000000..b6adc6e
--- /dev/null
+++ b/src/test/java/com/googlecode/jatl/HtmlWriterTest.java
@@ -0,0 +1,107 @@
+/**
+ * Copyright (C) 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.googlecode.jatl;
+
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.StringWriter;
+
+import org.junit.Test;
+
+public class HtmlWriterTest {
+
+	StringWriter writer = new StringWriter();
+	HtmlWriter html;
+	
+	@Test
+	public void testWriter() throws Exception {
+		//Do not write yet.
+		html = new HtmlWriter() {
+			@Override
+			protected void build() {
+				html().head().end().body();
+				text("Hello");
+				done();
+			}
+		};
+		//Now write.
+		String actual = html.write(writer).getBuffer().toString();
+		String expected = "\n" + 
+				"<html>\n" + 
+				"	<head>\n" + 
+				"	</head>\n" + 
+				"	<body>Hello\n" + 
+				"	</body>\n" + 
+				"</html>";
+		assertEquals(expected, actual);
+		
+	}
+	
+	private HtmlWriter createInput(final String name, final String value) {
+		return new HtmlWriter() {
+			@Override
+			protected void build() {
+				input().name(name).value(value).end();
+			}
+		};
+	}
+	
+	private HtmlWriter createForm(final HtmlWriter ... inputs) {
+		return new HtmlWriter() {
+			@Override
+			protected void build() {
+				form().write(inputs).end();
+			}
+		};
+	}
+	
+	@Test
+	public void testWriterMethod() throws Exception {
+
+		
+		final HtmlWriter input = createInput("test", "value");
+		
+		final HtmlWriter form = createForm(input);
+		
+		//Do not write yet.
+		html = new HtmlWriter() {
+			@Override
+			protected void build() {
+				html().head().end().body();
+				text("Hello");
+				write(form);
+				done();
+			}
+		};
+		
+		//Now write.
+		String actual = html.write(writer).getBuffer().toString();
+		String expected = "\n" + 
+				"<html>\n" + 
+				"	<head>\n" + 
+				"	</head>\n" + 
+				"	<body>Hello\n" + 
+				"		<form>\n" + 
+				"			<input name=\"test\" value=\"value\"/>\n" + 
+				"		</form>\n" + 
+				"	</body>\n" + 
+				"</html>";
+		assertEquals(expected, actual);
+		
+	}
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jatl.git



More information about the pkg-java-commits mailing list