unneeded imports in FileUtils git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@345256 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -0,0 +1,19 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |||||
| version="1.0"> | |||||
| <xsl:output method="xml"/> | |||||
| <xsl:template match="/"> | |||||
| <authors> | |||||
| <xsl:apply-templates/> | |||||
| </authors> | |||||
| </xsl:template> | |||||
| <xsl:template match="author"> | |||||
| <author> | |||||
| <xsl:attribute name="name"> | |||||
| <xsl:value-of select="@name"/> | |||||
| </xsl:attribute> | |||||
| </author> | |||||
| </xsl:template> | |||||
| </xsl:stylesheet> | |||||
| @@ -0,0 +1,13 @@ | |||||
| <?xml version="1.0" encoding="iso-8859-1"?> | |||||
| <!DOCTYPE books [ | |||||
| <!ENTITY globaldefinitions SYSTEM "entity.xml"> | |||||
| ]> | |||||
| <books> | |||||
| &globaldefinitions; | |||||
| <book name="the lord of rings"> | |||||
| <author name="tolkien"/> | |||||
| </book> | |||||
| <book name="le malade imaginaire"> | |||||
| <author name="moliere"/> | |||||
| </book> | |||||
| </books> | |||||
| @@ -0,0 +1,3 @@ | |||||
| <book name="hamlet"> | |||||
| <author name="shakespeare"/> | |||||
| </book> | |||||
| @@ -1,12 +1,24 @@ | |||||
| <?xml version="1.0" encoding="UTF-8" ?> | <?xml version="1.0" encoding="UTF-8" ?> | ||||
| <project name="xslt" default="xslt" basedir="."> | <project name="xslt" default="xslt" basedir="."> | ||||
| <property name="nonasciidir" value="xml/ãnt"/> | |||||
| <target name="init"> | <target name="init"> | ||||
| <mkdir dir="xml/out"/> | <mkdir dir="xml/out"/> | ||||
| </target> | </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"> | <target name="teardown"> | ||||
| <delete dir="xml/out"/> | <delete dir="xml/out"/> | ||||
| <delete dir="${nonasciidir}" quiet="true"/> | |||||
| </target> | </target> | ||||
| <target name="testCatchNoDtd" depends="init"> | <target name="testCatchNoDtd" depends="init"> | ||||
| @@ -60,6 +72,11 @@ | |||||
| </factory> | </factory> | ||||
| </xslt> | </xslt> | ||||
| </target> | </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> | |||||
| </project> | </project> | ||||
| @@ -17,34 +17,25 @@ | |||||
| package org.apache.tools.ant.util; | package org.apache.tools.ant.util; | ||||
| import java.io.BufferedInputStream; | |||||
| import java.io.BufferedReader; | |||||
| import java.io.BufferedWriter; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.io.InputStream; | import java.io.InputStream; | ||||
| import java.io.InputStreamReader; | |||||
| import java.io.OutputStreamWriter; | |||||
| import java.io.Reader; | import java.io.Reader; | ||||
| import java.io.Writer; | import java.io.Writer; | ||||
| import java.io.OutputStream; | import java.io.OutputStream; | ||||
| import java.net.MalformedURLException; | import java.net.MalformedURLException; | ||||
| import java.net.URL; | import java.net.URL; | ||||
| import java.text.CharacterIterator; | |||||
| import java.text.DecimalFormat; | import java.text.DecimalFormat; | ||||
| import java.text.StringCharacterIterator; | |||||
| import java.util.Random; | import java.util.Random; | ||||
| import java.util.Stack; | import java.util.Stack; | ||||
| import java.util.StringTokenizer; | import java.util.StringTokenizer; | ||||
| import java.util.Vector; | import java.util.Vector; | ||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.filters.util.ChainReaderHelper; | |||||
| import org.apache.tools.ant.taskdefs.condition.Os; | import org.apache.tools.ant.taskdefs.condition.Os; | ||||
| import org.apache.tools.ant.types.FilterSetCollection; | import org.apache.tools.ant.types.FilterSetCollection; | ||||
| import org.apache.tools.ant.types.resources.FileResource; | import org.apache.tools.ant.types.resources.FileResource; | ||||
| import org.apache.tools.ant.launch.Locator; | import org.apache.tools.ant.launch.Locator; | ||||
| import org.apache.xerces.util.URI; | |||||
| /** | /** | ||||
| * This class also encapsulates methods which allow Files to be | * This class also encapsulates methods which allow Files to be | ||||
| @@ -85,5 +85,8 @@ public class XsltTest extends BuildFileTest { | |||||
| public void testAttribute() throws Exception { | public void testAttribute() throws Exception { | ||||
| executeTarget("testAttribute"); | executeTarget("testAttribute"); | ||||
| } | } | ||||
| public void testXMLWithEntitiesInNonAsciiPath() throws Exception { | |||||
| executeTarget("testXMLWithEntitiesInNonAsciiPath"); | |||||
| } | |||||
| } | } | ||||