ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <sflo...@nc.rr.com>
Subject Re: Aw: Re: XSL transformation with Ant: sorting a list
Date Thu, 01 Jan 1970 00:00:00 GMT

Al,

It wasn't apparent to me why there'd be a difference...

If you are using the same JVM and simply executing the XSL differently, I don't see why not...

I mean once you kick of the XSL I can't imagine there is something different in running from
Ant vs your Java app.  I spent a number of years on an ESB team doing mostly XSLTs (and XSDs)
- I always used Ant to test even though we ran the XSLTs in our environments from Java.  I
never noticed any difference that way at all.


---- Al Le <Al.Le@gmx.de> wrote: 
> Hello Scot,
> 
> thanks for a quick response!
> 
> > first you are killing yourself in the way you XSLT is 
> > written
> > [. . .]
> > You are trying to do the work of the templating engine in your XSLT :)
> 
> Yes, I know this is a "procedural" way of doing things and maybe not the best. But the
example is just an example. The real script is much bigger and more complicated. I just tried
to give a simple case to reproduce the problem.
> 
> Do you also think that it should work (despite the fact that it's may be not the best
way to do it)?
> 
> The java program I used to verify the transformation is:
> 
> package my.test;
> 
> import java.io.File;
> import java.io.StringWriter;
> 
> import javax.xml.transform.Result;
> import javax.xml.transform.Source;
> import javax.xml.transform.Transformer;
> import javax.xml.transform.TransformerFactory;
> import javax.xml.transform.stream.StreamResult;
> import javax.xml.transform.stream.StreamSource;
> 
> public class Transform {
> 
> 	public static void main(String[] args) throws Exception {
> 		String inputFileName = "Q:\\MiscThings\\t\\a.xml";
> 		String xslFileName = "Q:\\MiscThings\\t\\trans.xsl";
> 
> 		Source xmlSource = new StreamSource(new File(inputFileName));
> 		Source xslSource = new StreamSource(new File(xslFileName));
> 
> 		StringWriter stringWriter = new StringWriter();
> 		Result transformationResult = new StreamResult(stringWriter);
> 
> 		TransformerFactory transformerFactory = TransformerFactory.newInstance();
> 		Transformer transformer = transformerFactory.newTransformer(xslSource);
> 		transformer.transform(xmlSource, transformationResult);
> 
> 		stringWriter.flush();
> 		String xmlResult = stringWriter.toString();
> 
> 		System.out.println(xmlResult);
> 	}
> 
> }
> 
> ---------------------------------------------------------------------
> 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