The -xsltc option is something new in Xalan 2.4.1.  You are actually using
Xalan 2.2.D11 packaged in JDK 1.4.  Please read this FAQ
(http://xml.apache.org/xalan-j/faq.html#faq-N100C3) on how to run Xalan
with JDK 1.4.

Morris Kwan
XSLT Development
IBM Toronto Lab
Tel: (905)413-3729
Email: [EMAIL PROTECTED]



                                                                                
                                                   
                      Philip Crotwell                                           
                                                   
                      <[EMAIL PROTECTED]        To:       Morris 
Kwan/Toronto/[EMAIL PROTECTED]                                             
                      .edu>                    cc:       [EMAIL PROTECTED]      
                                        
                                               Subject:  Re: xsltc:output and 
redirect example                                     
                      11/11/2002 09:11                                          
                                                   
                      PM                                                        
                                                   
                                                                                
                                                   
                                                                                
                                                   




Hi

Adding -xsltc gives
Invalid option: -xsltc

All caps fails as well...Invalid option: -XSLTC

Running your example gives:
Invalid option: -xsltc
file:///Users/crotwell/Developement/sod/xml/redirectTest.xsl; Line 8;
Column 39; javax.xml.transform.TransformerException:
java.lang.ClassNotFoundException: redirect


I have all of the jars in xalan's bin dir in the classpath, so it should
be finding everything. I also tried the redirect sample in
samples/extensions on both MacOSX and Solaris (both 1.4.1) and with all
jars in xalan's bin in the classpath and I get in both cases:

java.lang.ClassNotFoundException:
org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:130)
        at
org.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.java:269)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:630)

        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)

        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)

        at org.apache.xalan.xslt.Process.main(Process.java:865)
<?xml version="1.0" encoding="UTF-8"?>
<standard-out>
      Standard output:

file:///seis/data0/crotwell/xalan-j_2_4_1/samples/extensions/1-redir.xsl;
Line 24; Column 36; javax.xml.transform.TransformerException:
java.lang.ClassNotFoundException: redirect

  <main>
    -- look in 1-redir.out for the redirected output --

    Everything else
  </main>
</standard-out>


?
Philip

On Mon, 11 Nov 2002 [EMAIL PROTECTED] wrote:

> This example only works with XSLTC. Please use a command like the
following
> to run the transformation:
> > java org.apache.xalan.xslt.Process -in test.xml -xsl test.xsl -xsltc
>
> If you want to use the redirect extension with Xalan, please use the
> following example:
>
> <xsl:stylesheet
>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>    xmlns:redirect="http://xml.apache.org/xalan/redirect";
>    extension-element-prefixes="redirect"
>    version="1.0">
>    <xsl:template match="/">
>      <xsl:text>This goes to standard output</xsl:text>
>      <redirect:write file="blob.xml">
>        <xsl:text>This is written to the file 'blob.xml'</xsl:text>
>      </redirect:write>
>    </xsl:template>
> </xsl:stylesheet>
>
> For a detailed description on the redirect extension for Xalan, please
see
> http://xml.apache.org/xalan-j/extensionslib.html#redirect.
>
>
> Morris Kwan
> XSLT Development
> IBM Toronto Lab
> Tel: (905)413-3729
> Email: [EMAIL PROTECTED]
>
>
>
>
>                       Philip Crotwell
>                       <[EMAIL PROTECTED]        To:
[EMAIL PROTECTED]
>                       .edu>                    cc:
>                                                Subject:  xsltc:output and
redirect example
>                       11/11/2002 05:11
>                       PM
>
>
>
>
>
>
> Hi
>
> The example on the xalan-j web page,
> http://xml.apache.org/xalan-j/extensions_xsltc.html#redirect_ext
> looke like this:
>
> <xsl:stylesheet
>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>    xmlns:xsltc="http://xml.apache.org/xalan/xsltc";
>    xmlns:redirect="http://xml.apache.org/xalan/redirect";
>    xsl:version="1.0">
>    <xsl:template match="/">
>      <xsl:text>This goes to standard output</xsl:text>
>      <xsltc:output file="blob.xml">
>        <xsl:text>This ends up in the file 'blob.xml'</xsl:text>
>      </xsltc:output>
>      <redirect:write file="blob.xml" append="true">
>        <xsl:text>This is appended to the file 'blob.xml'</xsl:text>
>      </redirect:write>
>    </xsl:template>
> </xsl:stylesheet>
>
> But trying to run it with xalan-j 2.4.1, I get this:
> file:///Users/crotwell/Developement/sod/xml/redirectTest.xsl; Line 5;
> Column 22; XSLT Error
> (javax.xml.transform.TransformerConfigurationException):
> javax.xml.transform.TransformerException:
> javax.xml.transform.TransformerException: "xsl:version" attribute is not
> allowed on the xsl:stylesheet element!
>
> Deleteing the xsl:version line gives this:
> file:///Users/crotwell/Developement/sod/xml/redirectTest.xsl; Line 5;
> Column 5; XSLT Error
> (javax.xml.transform.TransformerConfigurationException):
> javax.xml.transform.TransformerException:
> javax.xml.transform.TransformerException: xsl:stylesheet requires
> attribute: version
>
> Apperently it is required, but not allowed! :)
>
> I figured out that it really wants just version="1.0" instead of
> xsl:version. Maybe that sould be fixed in the example.
>
> But, even that does not work. Running xalan2.4.1 on this, I don't get a
> blob.xml file. Instead I get this as the output, notice that the
> <xsltc:output and <redirect commands are just copied verbatum to the
> output.
>
> <?xml version="1.0" encoding="UTF-8"?>
> This goes to standard output<xsltc:output
> xmlns:redirect="http://xml.apache.org/
> xalan/redirect" xmlns:xsltc="http://xml.apache.org/xalan/xsltc";
> file="blob.xml">
> This ends up in the file 'blob.xml'</xsltc:output><redirect:write
> xmlns:redirect
> ="http://xml.apache.org/xalan/redirect";
> xmlns:xsltc="http://xml.apache.org/xalan
> /xsltc" append="true" file="blob.xml">This is appended to the file
> 'blob.xml'</r
> edirect:write>
>
> Can someone give me a working xsltc:output example?
>
> thanks,
> Philip
>
>
>
>
>


-------------------------------------------------------------------------------

Philip Crotwell             [EMAIL PROTECTED]
803-777-0955
-------------------------------------------------------------------------------





Reply via email to