ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Balch <david.ba...@continuing-education.oxford.ac.uk>
Subject RE: redirect:write not writing to separate files with ant
Date Mon, 19 Jan 2004 11:21:53 GMT
Hi Antoine,

Thanks for your suggestion. You were right in that the file is generated and
put in the wrong place - I did a filename search of the whole disk and found
it. However, it appears to be a problem with URL encoding of directory
names, rather than the names themselves.

My working copy is in:
"C:\Documents and Settings\BalchD\My Documents\working-copy", but the output
is sent to:
"C:\Documents%20and%20Settings\BalchD\My%20Documents\working-copy".

I might just move my working copy for a workaround, but in the interests of
bug-fixing, is this likely to be Ant, Xalan or WinXP?

Cheers,
Dave.

> -----Original Message-----
> From: Antoine Lévy-Lambert [mailto:antoine@antbuild.com]
> Sent: 16 January 2004 22:44
> To: Ant Users List
> Subject: Re: redirect:write not writing to separate files with ant
> 
> 
> Hi David,
> 
> I am not sure whether the problem detected by Michael Hudson 
> is fixed now.
> 
> The code of TraxLiaison.java has certainly changed quite a 
> bit since then.
> 
> this message of Robert Koberg is also interesting
> http://article.gmane.org/gmane.comp.jakarta.ant.user/21384/mat
> ch=+xalan+redirect+style
> 
> My experience is that one easily gets into trouble with file 
> resolution 
> issues with xalan, independently of ant too.
> 
> For instance I have a web application where I was trying to do 
> <xsl:import href='xyz'/> and I discovered that xalan was trying to
> resolve the hrefs relative to the directory of the input file rather 
> than relative to the directory of the current stylesheet.
> 
> So in my opinion your test2.txt gets generated, but is maybe in the 
> directory on the input data or of the xsl stylesheet, in any case not 
> where you wanted it to be.
> I also suffered the first time I tried to use xalan:redirect.
> 
> Cheers,
> 
> Antoine Levy-Lambert
> 
> 
> 
> http://article.gmane.org/gmane.comp.jakarta.ant.user/21384/mat
> ch=+xalan+redirect+style
> David Balch wrote:
> 
> >Hi,
> >
> >I'm having problems getting an XSLT using the redirect:write 
> extension in
> >Xalan to work with Ant. The attached testcase works fine 
> from command line,
> >but not Ant.
> >
> >Expected results: Two text files - "test.txt" and "test2.txt".
> >
> >Actual results (Ant): One text file - "test.txt"
> >Actual results (Command line): Two text files - "test.txt" 
> and "test2.txt".
> >
> >A look through the mailing list archive found a similar 
> problem in 2001 [0],
> >but I suspect that's fixed by now ;-). I would appreciate if 
> anyone could
> >suggest what's going wrong...
> >
> >---8<--- Setup ---8<---
> >
> >WinXP SP1
> >java version "1.4.1_02"
> >Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
> >Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)
> >Apache Ant version 1.6alpha compiled on September 6 2003
> >Xalan Version Xalan Java 2.5.0
> >
> >
> >---8<--- Command line ---8<---
> >
> >java org.apache.xalan.xslt.Process -IN test.xml -XSL 
> test.xsl -OUT test.txt
> >
> >
> >---8<--- Ant target ---8<---
> >
> ><target name="redirect" description="Test of redirect:write 
> in xslt via
> >ant.">
> >  <xslt in="test.xml" out="test.txt" style="test.xsl"/>
> ></target>
> >
> >
> >---8<--- XML source ---8<---
> >
> ><?xml version="1.0" encoding="UTF-8"?>
> ><test>
> >    <one>Hello, this is one.</one>
> >    <two>Hello, this is two.</two>
> ></test>
> >
> >
> >---8<--- XSL ---8<---
> >
> ><?xml version="1.0" encoding="UTF-8"?>
> ><xsl:stylesheet version="1.0"
> >xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >xmlns:redirect="http://xml.apache.org/xalan/redirect"
> >extension-element-prefixes="redirect">
> >    <xsl:output method="text"/>
> >    <xsl:template match="/test">
> >        <xsl:for-each select="one">
> >            <xsl:value-of select="."/>
> >        </xsl:for-each>
> >        <xsl:for-each select="two">
> >            <redirect:write select="'test2.txt'">
> >                <xsl:value-of select="."/>
> >            </redirect:write>
> >        </xsl:for-each>
> >    </xsl:template>
> ></xsl:stylesheet>
> >
> >
> >---8<--- END ---8<---
> >
> >I can write XSL testcases, but I don't really know Java, so 
> any suggestions
> >would be great.
> >
> >Cheers,
> >Dave.
> >
> >[0]
> >http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=us
er@ant.apache.o
>rg&msgId=46526
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message