[xsl] xalan + Arbortext Epic: Hanging

Subject: [xsl] xalan + Arbortext Epic: Hanging
From: dpenton@xxxxxxxxxxxxx
Date: Sun, 17 Jun 2001 15:27:14 -0400
I am working on a project that involves authoring of legal documents in xml.  The authoring tool
that we use is Arbortext's Epic product.  I want to do some of the postprocessing (i.e. checking for
adherence to authoring standards that are not enforced by the DTD) using xslt.  The native Epic
language (ACL) is good, but for various reasons I want to use xslt to do some things.

The Epic native language allows one to call a java, which can in turn ask Epic to provide the
current document in the form of a DOM Document.  (Epic's native language does not use DOM per se, so
the DOM structure is created for the use of languages other than the native language.)  Once I have
acquired the DOM Document, I apply a transform to it using xalan to create a report.

When I use xalan, it frequently hangs up Epic, never to return.  It appears to work with some
transforms, but not others.  However, the same xslt transform that hangs things up when I attempt to
transform the DOM version of the document works fine if I pull that document of the disk as a xalan
StreamSource and apply the transform.

I am doing all this on Windows 98, with xalan 2.1.0, and Sun jdk1.3.1.

I don't expect anyone will be able to give me an explicit answer as to what's wrong, but I wonder
whether anyone has experience debugging with xalan, so that I might figure out where the problem is.
I am very new to java, also, so it is certainly not beyond question that I am committing an obvious

Here is the code that hangs up:

public class EpicPrint {

     public static void runit() {

        Document domDocument;
        // First grab the DOM from Epic:
        domDocument = Acl.getDOMDocument("0");
        try {
            // Make the xalan DOM thingies:
            DOMSource aclDOMSource = new DOMSource(domDocument);
            DOMResult aclDOMResult = new DOMResult();
            TransformerFactory tFactory = TransformerFactory.newInstance();
            Transformer transformer =
                 tFactory.newTransformer(new StreamSource("report.xsl"));
             transformer.transform(aclDOMSource, aclDOMResult);
             // Note: the above call to transform will hang up.  If that line is replaced
             // by this using the same instance as the one Epic passed us, it works:
             //  transformer.transform(new StreamSource("sameinstance.xml"), aclDOMResult);
             Serializer serializer = SerializerFactory.getSerializer
             PrintWriter outputHtml =
                 new PrintWriter(new BufferedWriter( new FileWriter("report.xml")));
        } catch (Exception e) {
            Acl.execute("message \"Java Exception \"");

One of the many transforms that hangs it up is below.  This is just an example; it is otherwise
to what I am trying to do.  It (and all the other transforms that give problems) work with the same
instances that hang if I process them using the xalan command line procession

<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="/">
    <xsl:apply-templates select="//*[@change='alt']"/>

<xsl:template match="*[@change='alt']">
<  p>Found one</p>


I don't know if that is enough information.  If anyone has even general suggestions about how to
debug xalan (or my own code, if that is a problem) when things just hang up, I would be ever so

David Penton

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread