Hello!

No, Maven 2 doesn't require JDK 1.5.

I played around with a small XSLT to convert the MyFaces/Forrest XDoc
documents into Maven XDoc documents. The DTD


http://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk/xdoc/src/dtd/maven-xdoc.dtd

is slightly different. You can the attached files into http://svn.apache.org/repos/asf/myfaces/forrest/trunk/content/ plus the 'dtd' and 'entity' from http://svn.apache.org/repos/asf/forrest/trunk/main/webapp/resources/schema/ into a local temporary 'resource' directory and run ant. See the xmlcatalog element in the build file. (I failed to either disable DTD checking or attach an archive with the necessary files)

This will create a 'converted' directory with the new files. For testing
purposes I just copied these files into
http://atanion.net/repos/asf/tobago/trunk/tobago-core/src/site/xdoc and run

  mvn site

inside the tobago-core directory. Currently, generating the site inside
the Tobago root directory doesn't work due to

  http://jira.codehaus.org/browse/MNG-1455

The generated files will end up inside the 'target/site' directory. Far
from perfect but a starting point...

Regards,
Arvid


<?xml version="1.0" encoding="iso-8859-1"?>
<project name="xdoc-converter" default="convert">

  <target name="convert">
    <mkdir dir="converted"/>
    <xslt basedir="xdocs"
        destdir="converted"
        includes="**/*.xml"
        excludes="tabs.xml,site.xml"
        style="convert.xsl">
      <mapper type="glob" from="*.xml" to="*.xml"/>
      <xmlcatalog>
        <dtd
            publicId="-//APACHE//DTD Documentation V1.2//EN"
            location="resource/dtd/document-v12.dtd"/>
      </xmlcatalog>
    </xslt>
  </target>

</project>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
  <xsl:output method="xml"/>

  <xsl:template match="/">
    <xsl:text disable-output-escaping="yes">
      <![CDATA[
        <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation Maven//EN" "http://maven.apache.org/dtd/maven-xdoc.dtd";>
      ]]>
    </xsl:text>
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="section">
    <section>
      <xsl:attribute name="name">
        <xsl:value-of select="title"/>
      </xsl:attribute>
      <xsl:apply-templates mode="filter"/>
    </section>
  </xsl:template>

  <xsl:template match="title" mode="filter"/>

  <xsl:template match="footer"/>

  <xsl:template match="header">
    <head>
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
    </head>
  </xsl:template>

  <xsl:template match="link|anchor|fork" mode="filter">
    <a>
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates mode="filter"/>
    </a>
  </xsl:template>

  <xsl:template match="figure" mode="filter">
    <div>
      <img>
        <xsl:copy-of select="@*"/>
        <xsl:apply-templates mode="filter"/>
      </img>
    </div>
  </xsl:template>

  <xsl:template match="note" mode="filter">
    <blockquote>
      <h3>
        <xsl:value-of select="@label"/>
      </h3>
      <!-- XXX other attributes -->
      <xsl:apply-templates mode="filter"/>
    </blockquote>
  </xsl:template>

  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="@*|node()" mode="filter">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" mode="filter"/>
    </xsl:copy>
  </xsl:template>
<!--
  <xsl:template match="@xml:space" mode="filter"/>
-->
</xsl:stylesheet>

Reply via email to