/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
// For write operation
public class jvmtiGen
{
/**
* Write out usage and exit.
*/
private static void showUsage() {
"-IN <input XML file name> " +
"-XSL <XSL file> " +
"-OUT <output file name> " +
"[-PARAM <name> <expression> ...]");
}
// Global value so it can be ref'd by the tree-adapter
{
} else {
showUsage();
}
} else {
showUsage();
}
}
showUsage();
}
/*
* Due to JAXP breakage in some intermediate Tiger builds, the
* com.sun.org.apache..... parser may throw an exception:
* com.sun.org.apache.xml.internal.utils.WrappedRuntimeException:
* org.apache.xalan.serialize.SerializerToText
*
* To work around the problem, this program uses the
* org.apache.xalan.... version if it is available. It is
* available in J2SE 1.4.x and early builds of 1.5 (Tiger).
* It was removed at the same time the thrown exception issue
* above was fixed, so if the class is not found we can proceed
* and use the default parser.
*/
final String parserProperty =
"javax.xml.transform.TransformerFactory";
final String workaroundParser =
"org.apache.xalan.processor.TransformerFactoryImpl";
try {
/*
* If we get here, we found the class. Use it.
*/
" = " + workaroundParser);
} catch (ClassNotFoundException cnfex) {
/*
* We didn't find workaroundParser. Ignore the
* exception and proceed with default settings.
*/
}
factory.setNamespaceAware(true);
factory.setValidating(true);
factory.setXIncludeAware(true);
try {
// Use a Transformer for output
}
} catch (TransformerConfigurationException tce) {
// Error generated by the parser
// Use the contained exception, if any
x = tce.getException();
x.printStackTrace();
} catch (TransformerException te) {
// Error generated by the parser
// Use the contained exception, if any
x = te.getException();
x.printStackTrace();
} catch (SAXException sxe) {
// Error generated by this application
// (or a parser-initialization error)
x = sxe.getException();
x.printStackTrace();
} catch (ParserConfigurationException pce) {
// Parser with specified options can't be built
} catch (IOException ioe) {
// I/O error
}
} // main
}