10.4 Introducing Translation Rules

<..XSLTrans.java..>
 import java.io.*;
 import javax.xml.parsers.*;
 import javax.xml.transform.*;
 import javax.xml.transform.stream.*;
 import org.w3c.dom.*;
 
 public class XSLTrans {
   public static void main(String[] args)
        throws TransformerConfigurationException,
              TransformerException  {
       StreamSource in   = new StreamSource(new File(args[0]));
       StreamSource xslt = new StreamSource(new File(args[1]));
       StreamResult out  = new StreamResult(new File(args[2]));
 
       TransformerFactory fc = TransformerFactory.newInstance();
       Transformer transformer = fc.newTransformer( xslt );
       transformer.transform(in, out);
   }
 }
javac XSLTrans.java ; java XSLTrans in.xml xslt.xsl out.xml -_-_-

<..xslt.xsl..>
 <?xml version="1.0" encoding="UTF-8" ?>
 <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 >
   <xsl:template match="@*|*|text()|processing-instruction()" >
      <xsl:copy>
        <xsl:apply-templates
            select="@*|*|text()|processing-instruction()" />
      </xsl:copy>
   </xsl:template>
 </xsl:stylesheet>
-_-_-