[jdom-interest] Help XSLT/Piped Streams?

Charlie Wu daydayup at pabell.net
Tue Feb 6 23:50:22 PST 2001


Hi Markus:

I'm trying to compile your JDOMSimpleXSLTProcessor.java but somehow the
compiler
can't seem to be able to find these org.apache.trax.* files.. I have the
latest xalan-j_2_0_0
installed along with the latest xerces.jar, and I even un-jarred xalan.jar
but under org/apache
there is no trax directory.. only xml, xpath and xalan..

Any ideas what I'm missing here?

Thanks!

Charlie

----- Original Message -----
From: <markus_tripp at sonynetservices.com>
To: <Nick at neoworks.com>
Cc: <jdom-interest at jdom.org>
Sent: Tuesday, November 14, 2000 7:27 AM
Subject: Re: [jdom-interest] Help XSLT/Piped Streams?


>
>
> Hello,
>
> for test purposes it is often useful to process a XSLT transformations
> directly from a JDOM document using a XSL stylesheet. I know that a direct
> integration of XSLT into JDOM would be much better - and I think Bob is
> working on this - but sometimes a version which pipes the output to an
> external XSLT processor like Xalan would help for the moment. I wrote such
> a simple class which uses Apache Xalan 2 (http://xml.apache.org). I have
> attached the source file "JDOMSimpleXSLTProcessor.java" to this email.
> Within my project I placed the file into the package
> "org.jdom.contrib.xslt" because did not find a better place for now.
> Because I am behind a firewall I cannot place it directly to the CVS.
>
>
> Requirements:
> =============
>
> xalan.jar and xerces.jar in the classpath (make sure to have the latest
> Xalan 2 version in the classpath).
>
>
> Sample Code of using JDOMSimpleXSLTProcessor
> (TestJDOMSimpleXSLProcessor.java):
>
============================================================================
===
>
> import org.jdom.Document;
> import org.jdom.Element;
> import org.jdom.contrib.xslt.JDOMSimpleXSLTProcessor;
> import org.xml.sax.InputSource;
> import org.apache.trax.Result;
>
> public class TestJDOMSimpleXSLTProcessor {
>   public static void main(String[] args) {
>     Document document;
>     Element element;
>     InputSource xsl = new InputSource("foo.xsl");
>     Result out = new Result(System.out);
>
>     element = new Element("doc");
>     element.setText("Hello");
>     document = new Document(element);
>
>     try {
>       JDOMSimpleXSLTProcessor.process(document, xsl, out);
>     }
>     catch(Exception e) {
>       e.printStackTrace();
>     }
>   }
> }
>
>
> XSL file (foo.xsl):
> ===================
>
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
>   <xsl:template match="doc">
>     <out><xsl:value-of select="."/></out>
>   </xsl:template>
> </xsl:stylesheet>
>
>
> Markus Tripp
>
> (See attached file: JDOMSimpleXSLTProcessor.java)
>
>
>
>
>
> Nick Vincent <Nick at neoworks.com>@jdom.org on 13.11.2000 18:35:32
>
> Gesendet von:  jdom-interest-admin at jdom.org
>
>
> An:   "'jdom-interest at jdom.org'" <jdom-interest at jdom.org>
> Kopie:
> Thema:    [jdom-interest] Help XSLT/Piped Streams?
>
>
> Hi,
>
> I'm using JDOM at the moment, and am trying to pipe an output stream into
> Xalan, as per the instructions in the JDOM FAQ.  I have tried to get this
> working a lot of ways, but when I attempt to pipe the input the XSLT
parser
> hangs, as if it is still waiting for input from the input stream.
>
> The same code works if replace the input stream with othewr stream types
> (i.e. strings, files), and I have tried flushing the streams everywhere I
> can to no avail.  Is there any sample code of this working (I have checked
> out CVS today to see if this example has been added, but could not find
> it)?
>
> Many thanks,
>
>
> Nick Vincent
> NeoWorks
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
>
>
>
>




More information about the jdom-interest mailing list