alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Ant example source code file (xslt.xml)

This example Ant source code file (xslt.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Ant tags/keywords

utf-8, utf-8

The xslt.xml source code

<?xml version="1.0" encoding="UTF-8" ?>

<project name="xslt" default="xslt" basedir=".">
  <property name="nonasciidir" value="xml/ãnt"/>
  <target name="init">
      <mkdir dir="xml/out"/>
  </target>

  <target name="initNonAscii">
      <mkdir dir="${nonasciidir}"/>
      <copy todir="${nonasciidir}">
        <fileset dir="xml">
          <include name="docwithentity.xml"/>
          <include name="entity.xml"/>
        </fileset>
      </copy>
  </target>

  <target name="teardown">
      <delete dir="xml/out"/>
      <delete dir="${nonasciidir}" quiet="true"/>
  </target>
  
  <target name="testCatchNoDtd" depends="init">
    <xslt basedir="xml" destdir="xml/out"
           includes="about.xml"
           extension=".txt"
           style="xml/doc.xsl">
     </xslt>
  </target>
  
  <xmlcatalog id="xdocs.catalog">
   <dtd publicID="-//stevo//DTD doc 1.0//EN"
     location="xml/doc.dtd"/>
  </xmlcatalog>  
  
  <target name="testCatalog" depends="init">
    <xslt destdir="xml/out"
           includes="about.xml"
           extension=".txt"
           style="xml/doc.xsl">
       <xmlcatalog refid="xdocs.catalog"/>
     </xslt>
  </target>

  <target name="testOutputProperty" depends="init">
    <xslt in="xml/test.xml"
           out="xml/out/test-out.xml"
           style="xml/test.xsl">
      <outputproperty name="method" value="xml"/>
      <outputproperty name="standalone" value="yes"/>
      <outputproperty name="encoding" value="iso8859_1"/>
      <outputproperty name="indent" value="yes"/>
    </xslt>
  </target>
  
  
  <target name="testFactory" depends="init">
    <xslt in="xml/test.xml"
           out="xml/out/test-out.xml"
           style="xml/test.xsl">
           <factory name="org.apache.xalan.processor.TransformerFactoryImpl"/>
    </xslt>
  </target>

  <target name="testAttribute" depends="init">
    <xslt in="xml/test.xml"
           out="xml/out/test-out.xml"
           style="xml/test.xsl">
           <factory name="org.apache.xalan.processor.TransformerFactoryImpl">
            <attribute name="http://xml.apache.org/xalan/features/optimize" value="true"/>
           </factory>
    </xslt>
  </target>
  <!-- inspired by bug report 37348 -->
  <target name="testXMLWithEntitiesInNonAsciiPath" depends="initNonAscii">
    <xslt in="${nonasciidir}/docwithentity.xml"
           out="xml/out/test-out.xml"
           style="xml/apache.xsl">
    </xslt>
  </target>
  <target name="testStyleSheetWithInclude" depends="init">
    <xslt in="xml/books.xml"
           out="xml/out/test-out.xml"
           style="xml/stylesheet_with_include.xsl">
    </xslt>
  </target>
</project>

Other Ant examples (source code examples)

Here is a short list of links related to this Ant xslt.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.