Today, I encountered an exception when I tuned the code: Javax.xml.transform.TransformerConfigurationException:Could not compile stylesheet-fatal error: "Cannot mutate style sheet ", from the Internet to find a solution, the following paste out for later use."
The problem arises because the JDK's own xalan is castrated, and many features are not, such as Java-type method calls. What do we do?
The official Java notation is:
Apache-the Org.apache classes, which has never been supported J2SE APIs but is used by the Javax.xml package, which has MOV Ed in 5.0 to Com.sun.org.apache.package.internal so this they won ' t clash with more recent, developer-downloaded versions of the classes. Any applications this depend on the Org.apache classes being part of the J2SE release must does one of the following to work In 5.0:
Code the application so it uses only the supported interfaces that is part of the JAXP.
Download the Org.apache.xalan classes from Apache.
In short, the JDK has integrated some Apache libraries from 1.5 onwards, but changed the package name from Org.apache to com.sun.org.apache.package.internal to avoid collisions. So those castrated parts can safely put Apache bags into the classpath without fear of conflict. So just download a Xalan.jar package and put it in the project to solve this problem