JAXP

I altready have JAXP. I download it from the site given. But How can i configure that one? can you tell me detail about JAXP because refer to the documentation:

“The XSLT processor uses an XML parser to read both the source XML documents and the stylesheets. Most JAXP 1.1 XSLT processors will work with any JAXP 1.1 parser: typical examples of such parsers are Crimson, Xerces, AElfred, and Piccolo.

Again, it isn’t essential to tell the Tamino Passthru Servlet which XML parser you want to use, but it is good practice to do so. You can do this by means of the initialization parameter parser for the Passthru servlet. These parameters are described in Configuring the Tamino Passthru Servlet.

The xt processor will only work with James Clark’s xp parser. This is not a JAXP 1.1 compliant parser, so if you are using xt, you should not set this property.”

What is it mean by “if you are using xt, you should not see this praperty?” I am using xt so, can you tell me what should i do?
Thanks.



Siti Salmah Md Kassim

JAXP is a set of Java interfaces. There are basically two halves to it:

javax.xml.parsers.* defines interfaces to an XML parser, which may support SAX parsing, DOM parsing, or both

javax.xml.transform.* defines interfaces to an XSLT processor.

Most Java XSLT processors implement the javax.xml.transform.* interfaces, and they use the javax.xml.parsers.* interfaces to select an XML parser. So you can specify both the XSLT processor and the XML parser you want to use, independently of each other. This is why the Passthru servlet configuration allows you to set both properties.

xt was written before JAXP became available, so it doesn’t implement the javax.xml.transform.* interfaces, and it doesn’t use the javax.xml.parsers.* interfaces to select an XML parser. To make xt available under Passthru, we wrote a simple wrapper (the xtdriver.jar) that implements enough of the javax.xml.transform.* interface to make it usable. But xt still doesn’t use the javax.xml.parsers.* interfaces to select an XML parser (it simply uses the xp parser by default), so if the ParserFactory property is set in the configuration, it is simply ignored.

I hope this makes things clearer.

It might be a good idea to consider moving from xt to a more up-to-date XSLT processor. xt is fast and reliable, but it doesn’t implement the complete XSLT spec and has a few known bugs.

Michael Kay

OK, Now i move to other xslt processor, Xalan. So, did I need to configure this one…and how?

:confused:
thanks :slight_smile:



Siti Salmah Md Kassim

To run Xalan as your transformer, it is probably best to use Xerces as the XML parser, because they both come from the same development team and will have been well tested together.

For this combination, set the web.xml parameters as follows:


transformer
org.apache.xalan.processor.TransformerFactoryImpl





parser
org.apache.xerces.jaxp.SAXParserFactoryImpl





Then make sure that your classpath or lib directory includes the necessary JAR files, specifically xalan.jar and xercesImpl.jar. (This replaces xerces.jar which was included in earlier releases. I don’t think you need the other JAR file, xmlParserAPIs.jar, as this contains classes that are already present in xalan.jar).

Michael Kay

Hi Mike,
Which web.xml must I configure, or did I need to create new web.xml file and in what directory?
For use xerces as my transformer, what should I do instead of set the classpath?

Thanks,



Siti Salmah Md Kassim