[xsl] Saxon question..

Subject: [xsl] Saxon question..
From: "Duffey, Kevin" <KDuffey@xxxxxxxxxxxx>
Date: Thu, 18 Oct 2001 13:41:11 -0700
Hey all,

Not sure if this is the best place to ask this, but I know the author of
Saxon frequents this list. Basically, I want to know if Saxon has built in
ability to handle XML and XSL in various manners? Specifically, I have the
need to do one of two things with XML/XSL:

1) Pass in an XML and XSL, and get out an XML.

2) Pass in an XML and XSL, and get out a Document (Jaxp compatible) object,
already parsed.

The first one, I have working using a little bit of Java code:

  public static void transformXMLWithXSL(File sourceXML, File sourceXSL,
File target)
  {
    StreamSource xslStream = new StreamSource(sourceXSL);
    StreamSource xmlStream = new StreamSource(sourceXML);

    try
    {
      Templates templates = tFactory.newTemplates(xslStream);
      Transformer transformer = templates.newTransformer();
      transformer.transform(xmlStream, new StreamResult(new
FileOutputStream(target)));
    }
    catch(Exception e)
    {
      e.printStackTrace(System.out);
    }
  }

I don't know if this is the best way to do this, but it does work. I am
attempting to create a simple API that any of our applications can use to
allow conversion of one XML file format into our own format. Basically, we
will provide a "hub" to convert any format to our own format so that we can
more easily use our existing code to manipulate the incoming xml formats. We
have different software apps exporting their own but similar formats. I am
sure this is common to many of you. We will also like to use FO eventually
to produce PDF and RTF output files.

So before I go reinvent the wheel, does Saxon have built in API calls to do
this already? Or does it just provide the engine to transform?

Thanks.

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


Current Thread