git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275191 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -1,11 +1,26 @@ | |||
| <html> | |||
| <head> | |||
| <meta http-equiv="refresh" content="1; URL=packages.html"> | |||
| <title>Apache Ant API</title> | |||
| </head> | |||
| <body> | |||
| Redirecting to <a href="packages.html">Apache Ant API ...</a> | |||
| </body> | |||
| </html> | |||
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> | |||
| <!--NewPage--> | |||
| <HTML> | |||
| <HEAD> | |||
| <!-- Generated by javadoc on Sat Sep 06 10:24:18 CEST 2003--> | |||
| <TITLE> | |||
| Apache Ant API | |||
| </TITLE> | |||
| </HEAD> | |||
| <FRAMESET cols="20%,80%"> | |||
| <FRAMESET rows="30%,70%"> | |||
| <FRAME src="overview-frame.html" name="packageListFrame" title="All Packages"> | |||
| <FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)"> | |||
| </FRAMESET> | |||
| <FRAME src="overview-summary.html" name="classFrame" title="Package, class and interface descriptions"> | |||
| <NOFRAMES> | |||
| <H2> | |||
| Frame Alert</H2> | |||
| <P> | |||
| This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. | |||
| <BR> | |||
| Link to<A HREF="overview-summary.html">Non-frame version.</A> | |||
| </NOFRAMES> | |||
| </FRAMESET> | |||
| </HTML> | |||
| @@ -1,22 +1,37 @@ | |||
| <html> | |||
| <head> | |||
| <title>Apache Ant API</title> | |||
| </head> | |||
| <body> | |||
| <b>Apache Ant API has not been generated</b> | |||
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |||
| <!--NewPage--> | |||
| <HTML> | |||
| <HEAD> | |||
| <!-- Generated by javadoc (build 1.4.2) on Sat Sep 06 10:24:18 CEST 2003 --> | |||
| <TITLE> | |||
| (Apache Ant API) | |||
| </TITLE> | |||
| <p>If you see this page online at <a | |||
| href="http://ant.apache.org">ant.apache.org</a>, it is not a bug, but | |||
| on purpose. We do not provide an online version of the API docs, they | |||
| are included with all our distributions, including the nightly | |||
| builds.</p> | |||
| <p>If you want to see the API docs for the latest code, they are | |||
| generated by <a href="http://jakarta.apache.org/gump/">Apache Gump</a> | |||
| and linked from <a | |||
| href="http://nagoya.apache.org/gump/javadoc/ant/build/javadocs/index.html">http://nagoya.apache.org/gump/javadoc/ant/build/javadocs/index.html</a>.</p> | |||
| <LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> | |||
| </body> | |||
| </html> | |||
| <SCRIPT type="text/javascript"> | |||
| function windowTitle() | |||
| { | |||
| parent.document.title=" (Apache Ant API)"; | |||
| } | |||
| </SCRIPT> | |||
| </HEAD> | |||
| <BODY BGCOLOR="white" onload="windowTitle();"> | |||
| <BR> | |||
| <BR> | |||
| <BR> | |||
| <CENTER> | |||
| The front page has been relocated.Please see: | |||
| <BR> | |||
| <A HREF="index.html">Frame version</A> | |||
| <BR> | |||
| <A HREF="overview-summary.html">Non-frame version.</A></CENTER> | |||
| </BODY> | |||
| </HTML> | |||
| @@ -220,7 +220,7 @@ | |||
| <a name="FAQ about Borland Application Server tasks"></a> | |||
| FAQ about Borland Application Server tasks | |||
| </h4> | |||
| <p>Benoit Moussaud, the original author if the Borland | |||
| <p>Benoit Moussaud, the original author of the Borland | |||
| Application Server specific <a href="manual/OptionalTasks/ejb.html#ejbtasks">EJB tasks</a> has put | |||
| together a FAQ for this specific subtask.</p> | |||
| <table class="externals" cellspacing="1" cellpadding="4"> | |||
| @@ -226,6 +226,9 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||
| ((XSLTLoggerAware) liaison).setLogger(this); | |||
| } | |||
| Class cl = liaison.getClass(); | |||
| String s = cl.toString(); | |||
| log("Using " + liaison.getClass().toString(), Project.MSG_VERBOSE); | |||
| File stylesheet = getProject().resolveFile(xslFile); | |||
| @@ -566,22 +569,27 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||
| protected XSLTLiaison getLiaison() { | |||
| // if processor wasn't specified, see if TraX is available. If not, | |||
| // default it to xslp or xalan, depending on which is in the classpath | |||
| Class cl = null; | |||
| if (liaison == null) { | |||
| if (processor != null) { | |||
| try { | |||
| resolveProcessor(processor); | |||
| cl = liaison.getClass(); | |||
| } catch (Exception e) { | |||
| throw new BuildException(e); | |||
| } | |||
| } else { | |||
| try { | |||
| resolveProcessor("trax"); | |||
| cl = liaison.getClass(); | |||
| } catch (Throwable e1) { | |||
| try { | |||
| resolveProcessor("xalan"); | |||
| cl = liaison.getClass(); | |||
| } catch (Throwable e2) { | |||
| try { | |||
| resolveProcessor("xslp"); | |||
| cl = liaison.getClass(); | |||
| } catch (Throwable e3) { | |||
| e3.printStackTrace(); | |||
| e2.printStackTrace(); | |||
| @@ -591,6 +599,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||
| } | |||
| } | |||
| } | |||
| cl = liaison.getClass(); | |||
| return liaison; | |||
| } | |||
| @@ -701,7 +710,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||
| && project.getProperty(unlessProperty) != null) { | |||
| return false; | |||
| } | |||
| return true; | |||
| } | |||
| } // Param | |||
| @@ -953,4 +962,4 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||
| } // -- class Factory | |||
| } //-- XSLTProcess | |||
| } //-- XSLTProcess | |||
| @@ -61,6 +61,7 @@ import java.io.File; | |||
| import java.io.FileReader; | |||
| import java.io.IOException; | |||
| import java.io.Reader; | |||
| import java.io.FileWriter; | |||
| /** | |||
| @@ -112,6 +113,60 @@ public class StyleTest extends BuildFileTest { | |||
| "undefined='undefined default value'"); | |||
| } | |||
| public void testNewerStylesheet() throws Exception { | |||
| File xmlFile = new File("testNewerStylesheet.xml"); | |||
| File xslFile = new File("testNewerStylesheet.xsl"); | |||
| File outFile = new File("testNewerStylesheet.out"); | |||
| // create the first version of xml and xsl | |||
| String xml = "<data/>"; | |||
| StringBuffer xslHeader = new StringBuffer(); | |||
| StringBuffer xslFooter = new StringBuffer(); | |||
| xslHeader.append("<?xml version=\"1.0\"?>"); | |||
| xslHeader.append("<xsl:stylesheet"); | |||
| xslHeader.append(" version=\"1.0\""); | |||
| xslHeader.append(" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">"); | |||
| xslHeader.append("<xsl:template match=\"/\">"); | |||
| xslFooter.append("</xsl:template>"); | |||
| xslFooter.append("</xsl:stylesheet>"); | |||
| FileWriter xmlWriter = new FileWriter(xmlFile); | |||
| xmlWriter.write(xml); | |||
| xmlWriter.close(); | |||
| FileWriter xslWriter = new FileWriter(xslFile); | |||
| xslWriter.write(xslHeader.toString()); | |||
| xslWriter.write("old-string"); | |||
| xslWriter.write(xslFooter.toString()); | |||
| xslWriter.close(); | |||
| // make the first transformation | |||
| XSLTProcess xslt = new XSLTProcess(); | |||
| xslt.setProject(getProject()); | |||
| System.out.println("Project : " + getProject()); | |||
| xslt.setBasedir(getProject().getBaseDir()); | |||
| xslt.setStyle(xslFile.toString()); | |||
| xslt.setOut(outFile); | |||
| xslt.setIn(xmlFile); | |||
| xslt.execute(); | |||
| // modify the xsl | |||
| xslWriter = new FileWriter(xslFile); | |||
| xslWriter.write(xslHeader.toString()); | |||
| xslWriter.write("new-string"); | |||
| xslWriter.write(xslFooter.toString()); | |||
| xslWriter.close(); | |||
| xslt.perform(); | |||
| // make the second transformation | |||
| // test for 2nd transformation | |||
| xmlFile.delete(); | |||
| xslFile.delete(); | |||
| outFile.delete(); | |||
| } | |||
| // ************* copied from ConcatTest ************* | |||
| @@ -151,4 +206,4 @@ public class StyleTest extends BuildFileTest { | |||
| " but got " + content, content.indexOf(contains) > -1); | |||
| } | |||
| } | |||
| } | |||
| @@ -1,4 +1,4 @@ | |||
| <?xml version="1.0" encoding="ISO-8859-1" ?> | |||
| <?xml version="1.0" encoding="ISO-8859-1" ?> | |||
| <document> | |||
| <properties> | |||
| @@ -38,7 +38,7 @@ | |||
| </subsection> | |||
| <subsection name="FAQ about Borland Application Server tasks"> | |||
| <p>Benoit Moussaud, the original author if the Borland | |||
| <p>Benoit Moussaud, the original author of the Borland | |||
| Application Server specific <a | |||
| href="manual/OptionalTasks/ejb.html#ejbtasks">EJB tasks</a> has put | |||
| together a FAQ for this specific subtask.</p> | |||