Project

Profile

Help

newbee

Added by Anonymous about 18 years ago

Legacy ID: #3950895 Legacy Poster: sarvs (sarvs)

Hi, I have been given a task of writing a java class which would transform the xslt using saxon, just like the Transform class is doing using command line arguments. I wanted to know how I can go about it. Thanks S


Replies (1)

RE: newbee - Added by Anonymous about 18 years ago

Legacy ID: #3950918 Legacy Poster: Michael Kay (mhkay)

You should be able to do this largely by using standard JAXP interfaces (package javax.xml.transform), using Saxon-specific interfaces only if you need to do something outside the scope of JAXP. There are several ways you could start: (a) A general introduction to the API appears at http://www.saxonica.com/documentation/using-xsl/embedding.html (b) In the samples/java directory (download http://www.saxonica.com/download/saxon-resources8-8.zip) there's a program TraxExamples.java that illustrates a variety of ways of invoking transformations using the JAXP API, including some Saxon-specific extensions (c) In the same download you'll find the Saxon source code, including the module net.sf.saxon.Transform which provides Saxon's own command line interface. It's essentially a command-line wrapper around the JAXP interfaces. Feel free to study this code and use it as a pattern for your own. Michael Kay

    (1-1/1)

    Please register to reply