资源简介
xalan 系列最新全部jar包和文档
包括serializer.jar、xalan.jar、xercesImpl.jar、xml-apis.jar、xsltc.jar
解决Provider org.apache.xalan.processor.TransformerFactoryImpl not found错误。
代码片段和文件信息
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License Version 2.0 (the “License“);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: ApplyXPath.java 470245 2006-11-02 06:34:33Z minchau $
*/
// This file uses 4 space indents no tabs.
import java.io.FileInputStream;
import java.io.OutputStreamWriter;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.apache.xpath.XPathAPI;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.traversal.NodeIterator;
import org.xml.sax.InputSource;
/**
* Very basic utility for applying an XPath epxression to an xml file and printing information
/ about the execution of the XPath object and the nodes it finds.
* Takes 2 arguments:
* (1) an xml filename
* (2) an XPath expression to apply to the file
* Examples:
* java ApplyXPath foo.xml /
* java ApplyXPath foo.xml /doc/name[1]/@last
* @see XPathAPI
*/
public class ApplyXPath
{
protected String filename = null;
protected String xpath = null;
/** Process input args and execute the XPath. */
public void doMain(String[] args)
throws Exception
{
filename = args[0];
xpath = args[1];
if ((filename != null) && (filename.length() > 0)
&& (xpath != null) && (xpath.length() > 0))
{
// Tell that we‘re loading classes and parsing so the time it
// takes to do this doesn‘t get confused with the time to do
// the actual query and serialization.
System.out.println(“Loading classes parsing “+filename+“ and setting up serializer“);
// Set up a DOM tree to query.
InputSource in = new InputSource(new FileInputStream(filename));
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
dfactory.setNamespaceAware(true);
Document doc = dfactory.newDocumentBuilder().parse(in);
// Set up an identity transformer to use as serializer.
Transformer serializer = TransformerFactory.newInstance().newTransformer();
serializer.setOutputPro
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-03-26 11:21 xalan-j_2_7_2\
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:22 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:22 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:22 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\javax\xm
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\org\
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\org\apache\
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\org\apache\xalan\
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\org\apache\xalan\class-use\
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\org\apache\xalan\client\
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\org\apache\xalan\client\class-use\
目录 0 2014-03-26 11:21 xalan-j_2_7_2\docs\apidocs\org\apache\xalan\extensions\
............此处省略2983个文件信息
- 上一篇:lucene4.6所有jar包
- 下一篇:山寨版超级玛丽Java语言实现
评论
共有 条评论