<?xml version="1.0" encoding="UTF-8" ?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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

      https://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.
-->

<project name="xslt" default="tearDown" basedir=".">

  <import file="../../buildfiletest-base.xml"/>

  <target name="setUp">
    <mkdir dir="${output}" />
  </target>

  <target name="initNonAscii" depends="setUp">
    <property name="nonasciidir" value="${output}/&#0227;nt"/>
    <mkdir dir="${nonasciidir}"/>
      <copy todir="${nonasciidir}">
        <fileset dir="xml">
          <include name="docwithentity.xml"/>
          <include name="entity.xml"/>
        </fileset>
      </copy>
  </target>

  <target name="testCatchNoDtd" depends="setUp">
    <xslt basedir="xml" destdir="${output}"
           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="setUp">
    <xslt destdir="${output}"
           includes="about.xml"
           extension=".txt"
           style="xml/doc.xsl">
       <xmlcatalog refid="xdocs.catalog"/>
     </xslt>
  </target>

  <target name="testOutputProperty" depends="setUp">
    <xslt in="xml/test.xml"
           out="${output}/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="setUp">
    <xslt in="xml/test.xml"
           out="${output}/test-out.xml"
           style="xml/test.xsl">
           <factory name="org.apache.xalan.processor.TransformerFactoryImpl"/>
    </xslt>
  </target>

  <target name="testAttribute" depends="setUp">
    <xslt in="xml/test.xml"
           out="${output}/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="${output}/test-out.xml"
           style="xml/apache.xsl">
    </xslt>
  </target>
  <target name="testStyleSheetWithInclude" depends="setUp">
    <xslt in="xml/books.xml"
           out="${output}/test-out.xml"
           style="xml/stylesheet_with_include.xsl">
    </xslt>
  </target>
</project>
