<?xml version="1.0" encoding="utf-8"?>
<project basedir="." default="all" name="ToshibaHR">
  
  <taskdef classname="org.xmLP.ant.taskdefs.xslt.XSLTProcess" name="mtxslt"/>
  <property value="org.xmLP.ant.taskdefs.optional.TraXLiaison" name="trax"/>
  <!-- Saxon 6 -->
  <property name="saxon6.classpath" value="saxon.jar"/>
  <property name="saxon6" value="org.xmLP.ant.taskdefs.optional.Saxon6Liaison"/>
  
  
  <target name="init">
    <tstamp>
      <format property="build.date" pattern="yyyyMMdd"/>
      <format property="build.time" pattern="hhmmss"/>
    </tstamp>
    <delete dir="entries"/>
    <delete dir="convxml"/>
    <delete dir="conv_pieces"/>
    <delete dir="broken_out_xml"/>
  </target>
  <target depends="init" name="generate">
    <echo>Starting the generation process...
        -- Transforming Word XML to LSB content
    </echo>
    <mkdir dir="convxml"/>
    
    <mtxslt processor="${saxon6}" basedir="wordxml" destdir="convxml" style="Word2Xml.xsl" extension=".xml" classpath="${saxon6.classpath}"/>
    
  </target>
  
  
  <target depends="generate" name="two_pass">
    <echo>Starting the generation process...
        -- 2cnd Pass 'cleanup' Transformation on LSB content
    </echo>
    <mkdir dir="cleanxml"/>
    
    <mtxslt processor="${saxon6}" basedir="convxml" destdir="cleanxml" style="Word2Xml-2cndPass.xsl" extension=".xml" classpath="${saxon6.classpath}"/>
  </target>
  
  
  <target depends="two_pass" name="entries">
    <echo>Creating content entries for site.xml        
    </echo>
    <mkdir dir="entries"/>
    
    <mtxslt processor="${saxon6}" basedir="convxml" destdir="entries" style="content_entries.xsl" extension=".xml" classpath="${saxon6.classpath}"/>
    
  </target>
  
  
  <target depends="entries" name="pieces">
    <echo>Creating individual content pieces        
    </echo>
    <mkdir dir="broken_out_xml"/>
    <mkdir dir="conv_pieces"/>
    
    <mtxslt processor="${saxon6}" basedir="convxml" destdir="broken_out_xml" style="break_out_content.xsl" extension=".xml" classpath="${saxon6.classpath}"/>
    
  </target>


  <!--<taskdef name="validate" classname="org.iso_relax.ant.JARVTask"/>
  <target name="validate">
    <validate schemaLanguage="http://www.w3.org/2001/XMLSchema" schema="content.xsd">
      <fileset dir="content" includes="*.xml"/>
    </validate>
  </target>
  , validate-->
   <target name="all" depends="init, generate, entries, pieces"/> 
    
</project>
